Page 1 of 1

How to detect a static page?

Posted: Wed Jun 24, 2009 7:48 pm
by blog.brockha.us
A plugin of mine (twitter) adds something to the entry footer. It seems to be called by the static pages, too, and refuses them to load.

How do I detect securely, that it is indeed a static page and not a normal entry? At the moment my quick and dirty fix is to look, if a footer was set. But this also results in not displaying of my plugin, if an entry has no footer..

later: uh.. I'm too tired at the moment, to produce correct English. :D Sorry, I hope my question is understandable.. :)

Re: How to detect a static page?

Posted: Wed Jun 24, 2009 10:08 pm
by Don Chambers
I don't know what the php code would be, but in smarty, {if $staticpage_pagetitle} is true for static pages.... maybe you can reverse engineer it from there.

Re: How to detect a static page?

Posted: Thu Jun 25, 2009 12:41 am
by garvinhicking
Hi!

Which hook? Did you check $addData?

Regards,
Garvin

Re: How to detect a static page?

Posted: Thu Jul 02, 2009 7:44 pm
by blog.brockha.us
It's the hook entry_display.
Checking addData? Hmm.. What to look for? At the moment I'm checking

(!isset($entry['id']) || !is_numeric($entry['id']) || (int)$entry['id']<1)

if true, it seems to be a static page.

Re: How to detect a static page?

Posted: Fri Jul 03, 2009 8:16 am
by garvinhicking
Hi!

Maybe $serendipity['smarty']->get('staticpage_pagetitle') != '' will do?

Regards,
Garvin

Re: How to detect a static page?

Posted: Fri Jul 03, 2009 2:57 pm
by blog.brockha.us
Will this be there, if the twitterplugin is in front of the static pages plugin in the plugin list?
Have to check this. Thanks!