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; only on entries?

Development and Programming

ABDC's avatar
ABDC
71 posts
16 years ago
ABDC's avatar ABDC

I love the LG Social Bookmarks extension, however, does it also work WITHOUT any EE tags, like:

{lg_social_bookmarks title="This is the hard coded page title" permalink="http://www.mysite.com/mytemplategroup/mytemplate"}

so with all info hard coded instead of EE variables?

This way it would make it possible to add those links to ALL my pages on the site, not just article pages.

       
ABDC's avatar
ABDC
71 posts
16 years ago
ABDC's avatar ABDC

I managed to almost fake it:

I put a “useless” weblog:entries tag around:

{exp:weblog:entries limit="1"}

and used the {path} variable:

{lg_social_bookmarks title="Dagblad titels: verschijning en formaat" permalink="{path=dagbladen/verschijning_en_formaat}"}

The URL is parsed OK, but for some reason the title variable is not parsed, and instead the {title} of the latest entry in the database is taken as title. Anybody know how I can get around that?

       
notacouch's avatar
notacouch
92 posts
16 years ago
notacouch's avatar notacouch

Yeah I had a lot of trouble getting this to work. For some reason I have to put permalink first otherwise I get an error that no permalink parameter was used.

I looked into the code real quick and didn’t see anything for swapping in a title so I did a quick edit that seems to be working

in the file ext.lg_social_bookmarks_ext.php:

added $has_title below

if(isset($tag_params['sites']) === TRUE)
            {
               $tag_params['sites'] = explode("|", $tag_params['sites']);
            }

            $has_title = isset($tag_params['title']);

and swapped out this

$url = str_replace(LD.$key.RD, rawurlencode($value), $url);

for this

if($key == 'title' && $has_title)
                           {
                              $url = str_replace(LD.$key.RD, rawurlencode($tag_params['title']), $url);
                           }else{
                              $url = str_replace(LD.$key.RD, rawurlencode($value), $url);
                           }
       
Sean C. Smith's avatar
Sean C. Smith
3,818 posts
16 years ago
Sean C. Smith's avatar Sean C. Smith

Why not hand-roll your own bookmarks?

       
notacouch's avatar
notacouch
92 posts
16 years ago
notacouch's avatar notacouch
Why not hand-roll your own bookmarks?

I considered exactly that especially since a colleague had already implemented something similar. However, we’re not yet sure which bookmarks we want and were playing with the design of the box in which the links appear. It’s convenient to be able to pick, choose, and toggle as well as show clients the ease of which they can control/adjust this at will rather than call/wait on a developer.

       

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.