garvinhicking wrote:Because that's the easiest way to differentiate whether a staticpage is shown or not? I think template files like kinetic do have a reason for this. Maybe Don could elaborate on it? (Or I overread it?)
This is NOT unique to Kinetic. I addressed this a few posts earlier with this:
An option exists within static pages (and contact forms) to render the output to look like an entry ({if $staticpage_articleformat}), which seems to imply ("looks like output generated by entries.tpl"). This logic is processed solely within the static pages, not in entries.tpl.
In most templates, entries have a typical structure that usually includes the class serendipity_Entry_Date. plugin_staticpage.tpl, also sets this class *IF* a static page has been defined to look like an entry (from bulletproof):
Code: Select all
{if $staticpage_articleformat}
<div id="staticpage_{$staticpage_pagetitle|@makeFilename}" class="serendipity_Entry_Date serendipity_staticpage">
<h3 class="serendipity_date">{$staticpage_articleformattitle|@escape}</h3>
{/if}
There is no longer a way within entries.tpl to detect a static page, so no way to avoid html which may be duplicated in the static page tpls. In most templates, if not ALL templates other than 2k11 (which does not use the class serendipity_Entry_Date), static pages have a serendipity_Entry_Date container containing static page output followed by an additional serendipity_Entry_Date container rendered by entries.tpl. The second container is typically empty because entries.tpl had nothing further to contribute to the page.
Obviously, a very long time ago, other people realized that static page output could, and should, be different from that in entries.tpl. Why else would I have found notes within code saying exactly that? And why would we have options in plugins to "format as an entry", yet have no way to avoid that formatting if we cannot detect a static page within entries.tpl?
Either detecting static pages needs to be restored within entries.tpl, or static pages, contact forms, and other plugins which do not use entries.tpl, should skip it completely. My suggestion within content.tpl is not foolproof as a few plugins do require entries.tpl for html structure, unless they are modified so as not to need entries.tpl either.