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;
- not an image page, and;
- (optionally) in one of the sections listed in the
- (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.