Plug Ins for Homepage Only

Creating and modifying plugins.
Post Reply
tpelia
Regular
Posts: 10
Joined: Sun Jun 13, 2010 1:30 am

Plug Ins for Homepage Only

Post by tpelia »

Hi All,

Perhaps I've missed it in the discussion threads, but I can't seem to figure out how to have a plug in allow for an appearance only on the homepage (or index page).

Is there existing code for this?


Thanks!

Tom Elia
onli
Regular
Posts: 3044
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Plug Ins for Homepage Only

Post by onli »

Hi
You want to write the plugin yourself - are you asking for the php-code? For a sidebar-plugin?
tpelia
Regular
Posts: 10
Joined: Sun Jun 13, 2010 1:30 am

Re: Plug Ins for Homepage Only

Post by tpelia »

Yes. Is this possible? Right now, it appears it is only possible to have a plugin appear three ways, all of which include multiple pages.

What I would like to do is have a plugin appear only on one, single page. I know this is possible on Word Press, for example, but this will not work on Serendipity. Can it be done on Serendipity?


Tom
onli
Regular
Posts: 3044
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Plug Ins for Homepage Only

Post by onli »

Have a look at the html-nugget-plugin in include/plugin_internal.inc.php. it has a "show where?"-option which makes it possible to select overview-pages by observing $serendipity['GET']['id']. It'd of course be possible to regard another field of $serendipity, and maybe it's possible to display only on your occasion. When exactly do you want it to be displayed?
tpelia
Regular
Posts: 10
Joined: Sun Jun 13, 2010 1:30 am

Re: Plug Ins for Homepage Only

Post by tpelia »

I just want the html nugget in the sidebar to only be displayed on the homepage, not any other. Not, for example, on any "categories" pages, or the "archives" pages. Just the homepage.

Is this possible in Serendipity? if so, how do I do this?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Plug Ins for Homepage Only

Post by garvinhicking »

Hi!

Did you check the "Sidebar hider" s9y plugin ("serendipity_event_sidebarhider"). It should allow you to show/hide certain sidebar plugins on many conditions.

The other way always would be to edit your sidebar.tpl templatefile to add exclusion checks, I could instruct oyu further if the plugin doesn't already help

HTH,
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/
tpelia
Regular
Posts: 10
Joined: Sun Jun 13, 2010 1:30 am

Re: Plug Ins for Homepage Only

Post by tpelia »

Thank you! I'll try that and let you know how it goes!


Tom Elia
tpelia
Regular
Posts: 10
Joined: Sun Jun 13, 2010 1:30 am

Re: Plug Ins for Homepage Only

Post by tpelia »

I don't see a way to exclude the "archives" pages from appearing using this plugin.

Is there a way to do this?
Thanks!


Tom
Post Reply