Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
Current version:
0.1.9
About It:
Get it:
Rate it:
  • Helpful?
  • 4 Yes
  • 0 No
Flag it:
Contact Reason [ ? ]

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;
  • not an image page, and;
  • (optionally) in one of the sections listed in the section attribute, and;
  • (optionally) a single-page list or the first page of a multi-page list, if the pg attribute is set.

Information and download.

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.

Article Request Count:
Keywords/tags:
Initially released:
2009/07/08
Posted here:
08 Jul 2009
Article modified:
23 Feb 2017

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:

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
Published with Textpattern