How to detect a static page?

Creating and modifying plugins.
Post Reply
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

How to detect a static page?

Post 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.. :)
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: How to detect a static page?

Post 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.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: How to detect a static page?

Post by garvinhicking »

Hi!

Which hook? Did you check $addData?

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/
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Re: How to detect a static page?

Post 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.
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: How to detect a static page?

Post by garvinhicking »

Hi!

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

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/
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Re: How to detect a static page?

Post 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!
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
Post Reply