Page 1 of 1

Plug Ins for Homepage Only

Posted: Mon Aug 09, 2010 8:37 pm
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

Re: Plug Ins for Homepage Only

Posted: Mon Aug 09, 2010 8:56 pm
by onli
Hi
You want to write the plugin yourself - are you asking for the php-code? For a sidebar-plugin?

Re: Plug Ins for Homepage Only

Posted: Mon Aug 09, 2010 9:10 pm
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

Re: Plug Ins for Homepage Only

Posted: Tue Aug 10, 2010 8:40 pm
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?

Re: Plug Ins for Homepage Only

Posted: Thu Aug 12, 2010 11:16 pm
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?

Re: Plug Ins for Homepage Only

Posted: Fri Aug 13, 2010 12:26 am
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

Re: Plug Ins for Homepage Only

Posted: Fri Aug 13, 2010 10:49 pm
by tpelia
Thank you! I'll try that and let you know how it goes!


Tom Elia

Re: Plug Ins for Homepage Only

Posted: Thu Sep 09, 2010 2:22 am
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