$entry.has_extended, $is_single_entry, $entry.is_extended
Posted: Wed Feb 17, 2010 5:32 pm
Had some template logic that was not working as expected and decided to take a closer look at these smarty vars. I viewed these variables with extended body existing, and not existing, as well as overview and detailed page views.
Everything worked as expected except one thing - $entry.is_extended is never true if extended body does not exist. Why?
It seems $is_single_entry is true when viewing the extended entry (ie, entry body, extended body, comment form)..
This came up in the following context, found in many entries.tpl:
Truth is only one or the other of thse last two "and not" is necessary. The way this works, one cannot be true and the other false. They are both always false or always true if extended body exists.
Based on wording alone, I would like to see $entry.is_extended=true (1) for any detailed page view regardless of whether or not extended body exists... but at that point, it probably becomes redundant with $is_single_entry.
Either way, seems there may be one too many smarty vars in there, or there is some use for these I have yet to encounter.
Hope the above makes sense - cannot draw much of a chart here!
Everything worked as expected except one thing - $entry.is_extended is never true if extended body does not exist. Why?
It seems $is_single_entry is true when viewing the extended entry (ie, entry body, extended body, comment form)..
Code: Select all
No Xbody overview, No Xbody detailed, Yes Xbody overview, Yes Xbody detailed:
$entry.has_extended: null, nulll, 1, 1
$is_single_entry: null, 1, null, 1
$entry.is_extended: null, null, null, 1
Code: Select all
{if $entry.has_extended and not $is_single_entry and not $entry.is_extended}Based on wording alone, I would like to see $entry.is_extended=true (1) for any detailed page view regardless of whether or not extended body exists... but at that point, it probably becomes redundant with $is_single_entry.
Either way, seems there may be one too many smarty vars in there, or there is some use for these I have yet to encounter.
Hope the above makes sense - cannot draw much of a chart here!