Page 1 of 1

Custom Link in Entry Footer

Posted: Wed Jan 26, 2011 2:49 pm
by danst0
Hi,

is there a plugin to add a custom link (eg. Add this button) in the footer of an entry?

Daniel

Re: Custom Link in Entry Footer

Posted: Wed Jan 26, 2011 3:28 pm
by garvinhicking
Hi!

Yes, serendipity_event_findmore :)

(Or, you could edit your entries.tpl template to supply additional links there)

Regards,
Garvin

Re: Custom Link in Entry Footer

Posted: Wed Jan 26, 2011 3:30 pm
by yellowled
garvinhicking wrote:(Or, you could edit your entries.tpl template to supply additional links there)
Actually, an example for addthis integration can be found in Bulletproof's entries.tpl. If you can manage to wade through the code in there, of course. :)

YL

Re: Custom Link in Entry Footer

Posted: Wed Jan 26, 2011 4:51 pm
by Don Chambers
And finally, there is the plugin HTML Nugget on Page (serendipity_event_page_nugget) that will allow you to place code in various places on a page, including the entry footer.

Re: Custom Link in Entry Footer

Posted: Wed Jan 26, 2011 5:21 pm
by danst0
Thanks, nice plugin, I should have found it. But I want the link directly (same line) after the "Posted by ... in ... at ..." stuff.

Now I added the following lines just before the {$entry.add_footer} in the entries.tpl:

Code: Select all

| <a href="mailto:?body=http://domain.com{$entry.link}&subject={$entry.title}">Mail This</a>

| <a href="http://twitter.com/share?text={$entry.title|urlencode}&url=http://domain.com{$entry.link|urlencode}" target="_blank">Tweet This</a>
Can I get rid of the domain.com thing? Using another variable?

Daniel

Re: Custom Link in Entry Footer

Posted: Wed Jan 26, 2011 5:48 pm
by Don Chambers
danst0 wrote:Thanks, nice plugin, I should have found it. But I want the link directly (same line) after the "Posted by ... in ... at ..." stuff.

Now I added the following lines just before the {$entry.add_footer} in the entries.tpl:

Code: Select all

| <a href="mailto:?body=http://domain.com{$entry.link}&subject={$entry.title}">Mail This</a>

| <a href="http://twitter.com/share?text={$entry.title|urlencode}&url=http://domain.com{$entry.link|urlencode}" target="_blank">Tweet This</a>
Can I get rid of the domain.com thing? Using another variable?

Daniel
Probably, but I have not tested what you are attempting. $entry.link should be the full path to the entry.

Re: Custom Link in Entry Footer

Posted: Wed Jan 26, 2011 5:50 pm
by danst0
@Don: No it's not, only the later part... or did I do something wrong in the configuration?

Re: Custom Link in Entry Footer

Posted: Wed Jan 26, 2011 6:17 pm
by Don Chambers
danst0 wrote:@Don: No it's not, only the later part... or did I do something wrong in the configuration?
Try preceeding the entry link with {$serendipityBaseURL}.

If that does not work, I will actually have to try this for myself on one of my sandboxes... which means being less lazy!!! :wink:

Re: Custom Link in Entry Footer

Posted: Wed Jan 26, 2011 6:53 pm
by danst0
Works perfectly, I am using {$serendipityBaseURL|regex_replace:"[.$]":""} to get rid of the last "/", since else it is doubled due to the following {$entry.link}.

Daniel

Re: Custom Link in Entry Footer

Posted: Wed Jan 26, 2011 11:28 pm
by Don Chambers
Awesome! nice job!