Knowing where I am...

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

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
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

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.

# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy:
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby:

Post Reply