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.
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?
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);
}
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.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.