We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

LG Social Bookmarks 2.0 - Now and ExpressionEngine Extension!

Development and Programming

Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

Steven, you need to add the variable ‘$PREFS’ to the global variables in that function. ABout line 626, add $PREFS to this:

global $EXT, $FNS, $LANG, $OUT, $TMPL;

like this:

global $EXT, $FNS, $LANG, $OUT, $TMPL, $PREFS;
       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham

Thanks Ryan :D

       
Steven Grant's avatar
Steven Grant
894 posts
16 years ago
Steven Grant's avatar Steven Grant

Ok now I get this:

PHP Notice: Undefined variable: css in C:\domains\domain.co.uk\wwwroot\genesis\extensions\ext.lg_social_bookmarks_ext.php on line 636

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

OK, I’ve found that I cannot include the LG Social Bookmarks loop in an embed. I have an index page for my section that paginates through batches of 5 entries. At the bottom of each entry’s excerpt is a little button you can hover over to reveal all of the social bookmark links. If I put the code for social bookmarks directly into the entries loop on the index template, the social bookmarks show up fine. However, if I embed the bookmarks loop in an embed (_bookmarks.php) to try and keep my template clean, all that gets output in the markup is:

{lg_social_bookmarks title="The Title" permalink="http://site.com/group/template/title/"}
{social_sites}

{/social_sites}
{/lg_social_bookmarks}

So, the title and permalink are getting passed to the embed OK, but the tag pairs are not getting processed at all.

I’ll bring the bookmarks loop out of the embed for now, but just thought I’d point this out, as it seems a little weird. Same code in both places (only the embed is getting passed embed variables: {lg_social_bookmarks title="{embed:title}” permalink=”{embed:path}”} - and that is working OK). Also using the very latest EE 1.6.6, build 20081114.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

For the record, it would also be handy to have some sort of count inside this loop so I can determine first/last items to give them a different class.

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham
OK, I’ve found that I cannot include the LG Social Bookmarks loop in an embed. I have an index page for my section that paginates through batches of 5 entries. At the bottom of each entry’s excerpt is a little button you can hover over to reveal all of the social bookmark links. If I put the code for social bookmarks directly into the entries loop on the index template, the social bookmarks show up fine. However, if I embed the bookmarks loop in an embed (_bookmarks.php) to try and keep my template clean, all that gets output in the markup is:
{lg_social_bookmarks title="The Title" permalink="http://site.com/group/template/title/"}
{social_sites}

{/social_sites}
{/lg_social_bookmarks}
So, the title and permalink are getting passed to the embed OK, but the tag pairs are not getting processed at all. I’ll bring the bookmarks loop out of the embed for now, but just thought I’d point this out, as it seems a little weird. Same code in both places (only the embed is getting passed embed variables: {lg_social_bookmarks title="{embed:title}” permalink=”{embed:path}”} - and that is working OK). Also using the very latest EE 1.6.6, build 20081114.

The {lg_social_bookmarks} tag works just like the categories and related categories tags. This means it has to be used inside a weblog:entries tag.

I did this for a couple of reasons:

  1. to reduce the need for an extension and a plugin
  2. reduce the processing overhead

Only problem is that you can’t use this a a standalone template tag.

If I get time I’ll build an optional plugin that parses the values as well.

       
juro's avatar
juro
118 posts
16 years ago
juro's avatar juro

I am upgrading from 1.4.3 to 2.0.2 and have a problem. This is my template code:

{lg_social_bookmarks title="{embed:tool_title}" permalink="{embed:tool_permalink}"}
    Enjoy this post? Share it with others.
    <ul>
      {social_sites}
      <li>
        <a href="http://{social_site_url}" title="Bookmark on: {social_site_name}">_          /themes/cp_global_images/lg_social_bookmarks/favicons/{social_site_img_url}_          <span>Bookmark on {social_site_name}</span>_        </a>
      </li>
      {/social_sites}
    </ul>
  {/lg_social_bookmarks}

This template is embedded in various pages. But on these pages I get this:

{lg_social_bookmarks title="Some News" permalink="http://www.mysite.co.za/index.php/some_news/"} Enjoy this post? Share it with others. * {social_sites} {social_site_name} Favicon Bookmark on {social_site_name} {/social_sites} {/lg_social_bookmarks}

This template setup worked 100% with 1.4.3 but why does it print out the EE tags now? And yes, all the page embed this inside the weblog:entries tags.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

I had the same problem. Turns out you can’t embed this version. If you read the last few posts in this thread (including the one right before your post ahem) you’ll see why.

       
craiguffman's avatar
craiguffman
100 posts
16 years ago
craiguffman's avatar craiguffman

Leevi, Thanks for the helpful extension.

I am running. 2.02.

I am unable to make it point to the correct url for the target page of the post. For me, the correct url must be http://mysitename.org/template_group/{title} where {title} is the title of the weblog entry. The permalink parameter seems not to accept a variable, so I can’t say

permalink="{path=template_group/{title}}"  }

which seems what I need.

Also, can you explain if the \n\n{summary} portion is actually functional. It seems the brackets are reversed from what you intended. If i fix them in the lib file, would they actually do something, or are they not yet functional?

thanks!

       
brittanyA's avatar
brittanyA
184 posts
16 years ago
brittanyA's avatar brittanyA

Hey Leevi! I’m experiencing the same issue as someone above. I receive this message when trying to load a page:

“Error

There is no “permalink” parameter in the {lg_social_bookmarks} tag. Please check the documentation for more information.”

I’m using version 1.6.6 and PHP5

Any ideas? Thank you so much! 😊

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham
Hey Leevi! I’m experiencing the same issue as someone above. I receive this message when trying to load a page: “Error There is no “permalink” parameter in the {lg_social_bookmarks} tag. Please check the documentation for more information.” I’m using version 1.6.6 and PHP5 Any ideas? Thank you so much! 😊

Try:

permalink="{path=template_group}{title}/"
       
Hoosteeno's avatar
Hoosteeno
109 posts
16 years ago
Hoosteeno's avatar Hoosteeno

Howdy-

Love this extension. Thanks.

Should it work on gallery entries? It’s not for me, but that could be user error.

{exp:gallery:entries gallery="gallery" orderby="entry_date" limit="1"}
{entries}
{row}
{thumb_url}

{lg_social_bookmarks title="{title}" permalink="{id_path="gallery/item"}"}
  {social_sites}
    <a href="http://{social_site_url}" title="Bookmark on: {social_site_name}">_      /themes/cp_global_images/lg_social_bookmarks/favicons/{social_site_img_url}_    </a>
  {/social_sites}
{/lg_social_bookmarks}

{/row}
{/entries}
{/exp:gallery:entries}

Justin

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham

No, the current version of the extension only works in the weblog:entries tag

       
drpudding's avatar
drpudding
58 posts
16 years ago
drpudding's avatar drpudding

Just starting to use this cool extension. Quick question.

When I bookmark to Facebook, I see that it pulls the title & meta description of the page as the default text. Is there any way to customize that meta data, such as use a custom summary field for the article?

A little while later…

I just now happened to read about Better Meta 1.7, but it doesn’t appear to be able to pull custom field text in to meta data, right? Is that something I can only do by wrapping the meta field in an actual weblog:entries tag?

Thanks for any clarity!

       
tbritton's avatar
tbritton
714 posts
16 years ago
tbritton's avatar tbritton

This is the coolest little extension out there!

Just to give something back, I figured out (at a customer’s request) how to change the order of the icons (he wanted TwitThis first, Facebook second, etc.).

I went into the extensions folder and inside of the lg_social_bookmarks_ext folder is a lovely little file called lib.lg_social_bookmark_sites.php. Opening this one finds all the actual bits that relate to each social site. I simply cut and pasted the clearly obvious Facebook and TwitThis segments from where they were and pasted them up to the top, like this:

return array(
    
    'TwitThis' => array(
        'favicon' => 'twitter.png',
        'url' => 'http://twitthis.com/twit?url={permalink}',
    ),

    'Facebook' => array(
        'favicon' => 'facebook.png',
        'url' => 'http://www.facebook.com/sharer.php?u={permalink}&t={title}',
    ),

    'ASK' => array(
        'favicon' => 'ask.gif',
        'url' => 'http://myjeeves.ask.com/mysearch/BookmarkIt?v=1.2&t=webpages&url;={permalink}&title;={title}'
    ),

<-snip!->
Etc.
Etc.

Saved that, then opened up the extension’s settings in the extensions manager. There were my Twitter and Facebook in 1st and 2nd position. They were still selected. I deselected them both , the re-selected each one, and submitted the settings afresh. When I returned to my site and refreshed the pages, my new ordering jumped into place.

Thanks, Leevi - this is very cool that it is so adaptable and extensible (and I’m not even brave enough yet to play with the hooks you’ve left open for us to play with!)

Terry Leigh Britton (gotta switch to my full name - there’s a gazillion Terry Brittons!)

       
First 2 3 4 5 6

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.