soo_if_frontpage
Similar to the glx_if_frontpage tag from the no-longer-supported glx_if plugin. Most of glx_if’s functionality is now available through core Txp tags, but not this (well, not without an absurd stack of conditional tags). To glx_if_frontpage it adds txp:else /> compatibility, and a couple of attributes for more control.
soo_if_frontpage evaluates to true if the current page context is:
- an article list, and;
- not search results, and;
- not a listing of articles by category, and;
- not a listing of articles by author, and;
- not a listing of articles by month, and;
- (optionally) in one of the sections listed in the
sectionattribute, and; - (optionally) a single-page list or the first page of a multi-page list, if the
pgattribute is set.
Why? I was cleaning out some Txp cruft and was going to get rid of this little plugin, which I’ve been using privately for years. But re-discovered that it is genuinely useful for at least one small but important situation: styling the Home link in a nav bar. I want to give this an “active class” only if it is truly the home page, i.e. <http://my-site.com/>. Very cumbersome to do this with only core Txp tags.









If there is a comment form at the Information URL, you may want to leave your comments/questions there or at the Forum thread for quicker feedback. Otherwise, comment away:
Subscribe to this article's comments RSS feed. [ ? ] View Recent Comments across the site.