Knowing where I am...

Creating and modifying plugins.
Post Reply
User avatar
RobA
Regular
Posts: 317
Joined: Wed Apr 27, 2005 5:11 pm
Contact:

Knowing where I am...

Post by RobA » Tue Jun 21, 2005 7:41 pm

In an event plugin, is there anyway to know if the display is currently the multientry view, or a single entry view within the eventhook 'frontend_display'?

An example of the use of this would be to modify the author picture plugin so it only shows when looking at only one entry, rather than a list of multiple entries.

-Rob A>

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Knowing where I am...

Post by garvinhicking » Wed Jun 22, 2005 10:26 am

Yes, using PHP you can check that via:

Code: Select all

$is_single_entry = (isset($serendipity['GET']['id']) && is_numeric($serendipity['GET']['id']));


Inside smarty this is already available as {$is_single_entry}. It contains a boolean true/false.

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/

Post Reply