Custom Link in Entry Footer

Creating and modifying plugins.
Post Reply
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Custom Link in Entry Footer

Post by danst0 »

Hi,

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

Daniel
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Custom Link in Entry Footer

Post by garvinhicking »

Hi!

Yes, serendipity_event_findmore :)

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

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Custom Link in Entry Footer

Post 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
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Custom Link in Entry Footer

Post 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.
=Don=
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Re: Custom Link in Entry Footer

Post 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
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Custom Link in Entry Footer

Post 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.
=Don=
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Re: Custom Link in Entry Footer

Post by danst0 »

@Don: No it's not, only the later part... or did I do something wrong in the configuration?
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Custom Link in Entry Footer

Post 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:
=Don=
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Re: Custom Link in Entry Footer

Post 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
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Custom Link in Entry Footer

Post by Don Chambers »

Awesome! nice job!
=Don=
Post Reply