Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
pat-article-social
Created on 9th December 2013, before arc_social_share plugin by Sheffield (http://forum.textpattern.com/viewtopic.php?id=40319), here is my pat-article-social plugin:
http://pat-article-social.cara-tm.com
Last edited by Pat64 (2013-12-21 15:03:52)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: pat-article-social
There was a bug into the lite version (I haven’t tested it).
Please, download the new one available.
Sorry for inconvenience.
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: pat-article-social
New version 0.3.0 with catching for article share counts in order to preserve your website speed. Default catch delay (3 hours) can be set. No external javascript used:
http://pat-article-social.cara-tm.com/
Last edited by Pat64 (2014-02-15 10:14:33)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: pat-article-social
Hi,
Thanks for your work, the plugin works well!
However, there’s a nesting problem which made bad things a my error pages…
Here is the tiny fix :
- <meta property="twitter:title" content="<txp:if_article_list>{$title}<txp:else /><txp:title no_widow="0" /></txp:if_article_list>">
+ <meta property="twitter:title" content='<txp:if_article_list>{$title}<txp:else /><txp:title no_widow="0" /></txp:if_article_list>'>
- <meta property="og:title" content="<txp:if_article_list>{$title}<txp:else /><txp:title no_widow="0" /></txp:if_article_list>">
+ <meta property="og:title" content='<txp:if_article_list>{$title}<txp:else /><txp:title no_widow="0" /></txp:if_article_list>'>
- <meta itemprop="title" content="<txp:if_article_list>{$title}<txp:else /><txp:title no_widow="0" /></txp:if_article_list>">
+ <meta itemprop="title" content='<txp:if_article_list>{$title}<txp:else /><txp:title no_widow="0" /></txp:if_article_list>'>
Offline
Re: pat-article-social
Hi Nicolas.
Thanks.
Which plugin version do you use?
Try a more recent one: https://github.com/cara-tm/pat_article_social
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Offline
Re: pat-article-social
Plugin help updated for 0.4.7: https://github.com/cara-tm/pat_article_social/blob/master/help.md
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: pat-article-social
I get this error with 0.4.6, 0.4.7 and 0.4.8:
Parse error: syntax error, unexpected T_FUNCTION in /home/site/www/textpattern/lib/txplib_misc.php(812) : eval()'d code on line 62
Les erreurs ci-dessus ont été causées par le plugin :pat_article_social
Any idea?
Edit: last release works fine after switiching to PHP5.5
Last edited by NicolasGraph (2015-03-28 13:16:00)
Offline
Re: pat-article-social
With 0.4.5 I used to turn off the icons to use my owns but after upgrading to 0.4.8 the same tags and attributes display the first letter of the social site name after my icons. Is there a way to turn it off or should I edit the plugin to remove that?
Offline
Re: pat-article-social
NicolasGraph wrote #289527:
I get this error with 0.4.6, 0.4.7 and 0.4.8:
Parse error: syntax error, unexpected T_FUNCTION in /home/site/www/textpattern/lib/txplib_misc.php(812) : eval()'d code on line 62 Les erreurs ci-dessus ont été causées par le plugin :pat_article_social
Any idea?Edit: last release works fine after switiching to PHP5.5
Thanks Nicolas for this report. I will check today a solution to avoid this error message.
NicolasGraph wrote #289529:
With 0.4.5 I used to turn off the icons to use my owns but after upgrading to 0.4.8 the same tags and attributes display the first letter of the social site name after my icons. Is there a way to turn it off or should I edit the plugin to remove that?
No. Not actually. This is a fallback for old browsers that don’t support SVG format.
You can use this tiny script (I use in my Alison CSS framework project) in order to check CSS3 browsers support:
/*! Simple CSS3 support detector */ var Detect=(function(){var props="borderRadius,svg,columns,flex".split(","),CSSprefix="Webkit,Moz,O,ms,Khtml".split(","),d=document.createElement("detect"),test=[],p,pty;function TestPrefixes(prop){var Uprop=prop.charAt(0).toUpperCase()+prop.substr(1),All=(prop+' '+CSSprefix.join(Uprop+' ')+Uprop).split(' ');for(var n=0,np=All.length;n<np;n++){if(d.style[All[n]]==="") return true}return false}for(p in props){pty=props[p];test[pty]=TestPrefixes(pty);}return test;}());var html=document.getElementsByTagName('html')[0];for(t in Detect){if(Detect[t]) html.className+=' '+t.toLowerCase()};
You’ve got 4 classes in your <html>
tag: borderRadius
, svg
, columns
and flex
.
Now, add this in your CSS rules:
/* Hide SVG fallback */ .svg .social span { display: none;}
Another solution for the upcoming 0.4.9 version: do you prefer a new “fallback” attribute for hiding or not these first letters?
Last edited by Pat64 (2015-03-29 07:17:57)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: pat-article-social
Hi Patrick,
Thanks for replying.
Pat64 wrote #289534:
This is a fallback for old browsers that don’t support SVG format.
I’m not sure to understand; my browser (FF36) supports SVG format, I wouldn’t expect to see any fallback.
You can use this tiny script in order to check CSS3 browsers support.
Honestly when I use this kind of plugin it’s to avoid me to add scripts.
Do you prefer a new “fallback” attribute for hiding or not these first letters?
As I’m using FontAwesome in the project I’m working on, I manage my icons with the title
attribute and turn the icon
attribute off. As icon
is set to 0
I wouldn’t expect any fallback, but in other cases, when users use custom SVG icons, it would be useful probably…
Offline
Re: pat-article-social
First of all. Error message will never occur now: https://github.com/cara-tm/pat_article_social/commit/3c54887b375a5969f4c1e0722298020adc60735f
NicolasGraph wrote #289536:
Hi Patrick,
Thanks for replying.
You’re welcome
I’m not sure to understand; my browser (FF36) supports SVG format, I wouldn’t expect to see any fallback.
So, you’ve got the SVG icons and the first letters. Right? In this case, it’s normal ;)
Honestly when I use this kind of plugin it’s to avoid me to add scripts.
You’re right. That’s why this plugin exists ;)
So “fallback” attribute added: https://github.com/cara-tm/pat_article_social/commit/a162d63cda94cd6642eed1aa2f7d837eb7ef5a3c
Default: true (first letters are shown). So, if you set this attribute to 0
value, no first letters are shown.
You can download the 0.4.9 version today when I finish to add support for Instagram service (I need to register the plugin to have a key API ).
As I’m using FontAwesome in the project I’m working on, I manage my icons with the
title
attribute and turn theicon
attribute off. Asicon
is set to0
I wouldn’t expect any fallback, but in other cases, when users use custom SVG icons, it would be useful probably…
Interesting. This is what I thing to add in the plugin (as a fallback for SVG icons). Could you tell me how you make?
Last edited by Pat64 (2015-03-29 08:37:10)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline