NP_CatListVars.php

Adds variables available in the Category List Item field of templates.

General Plugin info
Author: Frank Truscott
Current Version: 1.0
Download: NP_CatListVars.zip
Forum Thread: here

Prerequisites

Requires Nucleus CMS version 3.40 or higher

Installing

  1. Unzip the file and upload the contents to your plugin directory
  2. Add category template variables as described below

How to use the plugin

Install it and add the variables to your template as desired

Available TemplateVars

The variables described below are only available in the Category List Item field of your templates and can be used to enhance the category lists on your site.

  • <%numitems%> : displays the number of items in the listed category.
  • <%catiscurrent%> : displays 'yes' if the listed category is the currently selected category. displays 'no' otherwise. This is useful for having different CSS classes to display the category element.

Options

//None//

Tips and Tricks

An example of a Category List Item field using these extra variables:

In CSS file:

.currentcat_no a {
	font-weight:normal;
}
.currentcat_yes a {
	font-weight:bold;
}

In Category List Item field of the template used to display your categorylist:

<li class="currentcat_<%catiscurrent%>"><a href="<%catlink%>" title="<%catname%>"><%catname%> [<%numitems%>]</a></li>

Results as HTML:

<li class="currentcat_no"><a href="http://domain.tld/cars/" title="Cars">Cars [20]</a></li>
<li class="currentcat_yes"><a href="http://domain.tld/downloads/" title="Downloads">Downloads [13]</a></li>
<li class="currentcat_no"><a href="http://domain.tld/general/" title="General">General [51]</a></li>
<li class="currentcat_no"><a href="http://domain.tld/sports/" title="Sports">Sports [37]</a></li>
<li class="currentcat_no"><a href="http://domain.tld/todo/" title="To Do">To Do [3]</a></li>

To viewer it looks like:

  • Cars [20]
  • Downloads [13]
  • General [51]
  • Sports [37]
  • To Do [3]

Wishlist

Bugs

History

  • Version 1.0, released 13 April 2009 ]
    • initial release
catlistvars.txt · Last modified: 2009/04/13 18:55 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki