? Success

User tests: Successful: Unsuccessful:

avatar wilsonge
wilsonge
16 Jul 2013

This starts the process of making some features not already in the CMS available as JLayouts. This starts with:

  • Facebook Like
  • Twitter Share
  • Twitter Follow
  • Twitter Hashtag
  • Twitter Mention
  • Google +1

Tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=31516

Screenshot

image

Note including them in articles is _NOT_ included in this PR - this is just demonstrating their use

Layout Params

Google+1

  • data-size small, medium, standard, tall Size of the icon - default standard.
  • data-annotation inline, bubble, none The style of annotation to appear - default inline.
  • data-width integer The width of the icon - default 300
  • data-href URL The URL for the like to link to. By default the current URL (JUri::current())
  • show-count true/false Show/Hide the number of people who have +1'd the page
  • language Language string recognized by google Defaults to the locale according to the language (https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/language/language.php#L1213).

Facebook Like

  • appid integer The appid if one exists for the like to link with
  • data-href URL The URL for the like to link to. By default the current URL (JUri::current())
  • data-width integer The width of the icon - default 450
  • show-faces true/false Shows the faces of others who have liked the page. Default true.
  • data-layout standard, button_count, box_count Layout of button. Default standard.
  • data-action 'empty attribute'/like, recommend Verb for the button. Default empty (which is "like").
  • data-colorscheme light, dark Color scheme. Default like
  • language Language string recognized by fb Defaults to the locale according to the language (https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/language/language.php#L1213).

Twitter

Follow

  • show-count true/false Show the number of users followed. Default false
  • user Valid Twitter user The user for twitter. If not entered will give a JLog priority warning.

Share

To be written up (see code for now)

Hashtag

To be written up (see code for now)

Mention

To be written up (see code for now)

Issues

  • Is my new language file in a good location and with a good name?
  • Twitter hashtag langs don't seem to work at the moment (the other twitter views do)
  • Is the location of the social layouts package in a good place?

Testers

  • Check multiple instances of each icon work
  • Check each icon work
  • Check parameters work as expected
  • Check multilingual aspect

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)
avatar wilsonge wilsonge - open - 16 Jul 2013
avatar elinw
elinw - comment - 16 Jul 2013

I love this. Where do you think we should store parameters?

avatar wilsonge
wilsonge - comment - 16 Jul 2013

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.

avatar mbabker
mbabker - comment - 16 Jul 2013

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.

avatar wilsonge
wilsonge - comment - 16 Jul 2013

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)
.

avatar wilsonge
wilsonge - comment - 18 Jul 2013

@mbabker thanks for the plugin link. It actually gave me some great ideas to refactor the Layouts. Hopefully in a much better position now!

avatar phproberto
phproberto - comment - 18 Jul 2013

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.

avatar wilsonge
wilsonge - comment - 18 Jul 2013

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 :)

avatar phproberto
phproberto - comment - 18 Jul 2013

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.

avatar wilsonge
wilsonge - comment - 18 Jul 2013

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.

avatar elinw
elinw - comment - 28 Jul 2013

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.

avatar wilsonge
wilsonge - comment - 29 Jul 2013

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?

avatar wilsonge
wilsonge - comment - 29 Jul 2013

Will work on super JLayout block

avatar wilsonge
wilsonge - comment - 9 Aug 2013

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.

avatar wilsonge wilsonge - close - 9 Aug 2013
avatar wilsonge wilsonge - reopen - 16 Aug 2013
avatar brianteeman
brianteeman - comment - 23 Jul 2014

What is the status with this @wilsonge

avatar wilsonge
wilsonge - comment - 23 Jul 2014

feature still pending awaiting testers. i'll move it across to target staging later

avatar brianteeman brianteeman - change - 21 Aug 2014
Status New Pending
avatar brianteeman brianteeman - change - 21 Aug 2014
Build .
avatar brianteeman brianteeman - change - 2 Sep 2014
Category Layout
avatar roland-d
roland-d - comment - 29 Nov 2014

@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.

avatar roland-d roland-d - test_item - 29 Nov 2014 - Tested unsuccessfully
avatar wilsonge
wilsonge - comment - 29 Nov 2014

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

avatar wilsonge wilsonge - change - 29 Nov 2014
Title
Start a JLayout Social
[#31516] Start a JLayout Social
avatar wilsonge
wilsonge - comment - 29 Nov 2014

Because this is so old it's targeted at master I've created a fresh version targeting staging at #5252 - try that and see how you go.

Closing this one as a result

avatar wilsonge wilsonge - close - 29 Nov 2014
avatar wilsonge wilsonge - change - 29 Nov 2014
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2014-11-29 22:56:08

Add a Comment

Login with GitHub to post a comment