User tests: Successful: Unsuccessful:
This starts the process of making some features not already in the CMS available as JLayouts. This starts with:
Tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=31516
Note including them in articles is _NOT_ included in this PR - this is just demonstrating their use
To be written up (see code for now)
To be written up (see code for now)
To be written up (see code for now)
Suggested code:
$layout = new JLayoutFile('social.google');
echo $layout->render(array());
$layout2 = new JLayoutFile('social.twitter.share');
echo $layout2->render(array());
$layout3 = new JLayoutFile('social.facebook');
echo $layout3->render(array());
$layout4 = new JLayoutFile('social.twitter.follow;);
echo $layout4->render(array('user'=>'GW1992')); // or similar for a twitter username (please don't spam mine :P)
Just to put up what we're just talking about on skype. Personally a new section where the Component options are set (so Global Config but not actually in Global Config). Called Layouts. Starting with one tab (social). This then gets expanded as more JLayouts are introduced.
Feel free to borrow code out of https://github.com/mbabker/Yet-Another-Social-Plugin/blob/master/yetanothersocial.php if need be, I've spent a little time figuring out the language implementations. Could be improved on, but it's a good start.
Hmm what you have is interesting there but is specific to an article - but
clearly JLayout isn't (thinking of K2 etc. which already has a Facebook
etc. button). So I guess you have to get the global language/logged in user
language....
Having said that I might well hijack those language setting functions you
have - cause all I need to change are the inputs :)
Thanks Michael - actually that's going to be a great help!!
On 16 July 2013 01:49, Michael Babker notifications@github.com wrote:
Feel free to borrow code out of
https://github.com/mbabker/Yet-Another-Social-Plugin/blob/master/yetanothersocial.phpif need be, I've spent a little time figuring out the language
implementations. Could be improved on, but it's a good start.—
Reply to this email directly or view it on GitHub#1550 (comment)
.
Have you looked at:
http://filamentgroup.com/lab/socialcount/
Maybe now is too late but I love the idea of only require 3KB for sharing. I'd never use the "old" share buttons but this jQuery plugin is awesome.
In a word - no :P
I did initially for G+ and facebook use the inline javascript. But I was unhappy with the fact you were including it with every use of the button. For example in cases where you might have the fb like button in a module and then again in a blog post.
Loading it in the head with JDocument gave me a way out of that.
If you can find a way around this though I'm more than happy to consider it. I'd rather get it right now then face the consequences later on!
P.S. Also just reading the comments of your link there that plugin breaks on mobiles (well definitely iPhones - I just tested it on mine) and on IE10 (just tested that as well). I get the idea though :)
Yes. I went to the github project to check issues and the plugin seems abandoned :(
About your PR I tested it and all seems to work fine. In my opinion layouts are in the best place and hashtag language worked fine here. So no issues
Are Twitter translations really required? I tested it in spanish and worked perfect before creating the language file.
RE: language files - I'm not sure. Some of them I don't think are. The twitter website puts these things in the link tags https://twitter.com/about/resources/buttons but then just the data-language tag seems to set everything up fine (good to hear the language on the hashtags worked for you!)
Either way I still need the file for my two error messages if people don't include a hashtag for the hashtag layout and a user for the follow/mention layout.
For the code try
<?php $layout = new JLayoutFile('social.google');
echo $layout->render(array());
$layout2 = new JLayoutFile('social.twitter.share');
echo $layout2->render(array());
$layout3 = new JLayoutFile('social.facebook');
echo $layout3->render(array());
$layout4 = new JLayoutFile('social.twitter.follow');
echo $layout4->render(array('user'=>'GW1992')); ?>
I'd suggest making a super JLayout that then includes all of them in a block. I'd be game for including these default off as a simple on/ff block. I do think we need to think about complex storing of params but for right now we could do it on a per site basis and let webmaster, implementers and developers go to town with more complex.
Also I was thinking as a default user if one isn't set perhaps we should use the Joomla twitter feed rather than throwing an error?
Will work on super JLayout block
Ok as discussed on skype I'm not going to have a master layout. However I am going to put in a JHtml class to call these functions. Just committed these now.
feature still pending awaiting testers. i'll move it across to target staging later
Status | New | ⇒ | Pending |
Build | ⇒ | . |
Category | ⇒ | Layout |
@test The PR cannot be applied:
D:\wamp\www\joomla-cms>curl https://github.com/joomla/joomla-cms/pull/1550.diff
| git apply -R
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 18317 0 18317 0 0 26623 0 --:--:-- --:--:-- --:--:-- 32534
error: language/en-GB/en-GB.layout_social.ini: No such file or directory
error: layouts/social/facebook.php: No such file or directory
error: layouts/social/google.php: No such file or directory
error: layouts/social/index.html: No such file or directory
error: layouts/social/twitter/follow.php: No such file or directory
error: layouts/social/twitter/hashtag.php: No such file or directory
error: layouts/social/twitter/index.html: No such file or directory
error: layouts/social/twitter/mention.php: No such file or directory
error: layouts/social/twitter/share.php: No such file or directory
error: libraries/cms/html/social.php: No such file or directory
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/1550.
Well somethings very wrong with your git then :P Because none of those files do exist yet. They are supposed to be created by this PR
Title |
|
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-11-29 22:56:08 |
I love this. Where do you think we should store parameters?