NAV_LIST_UL & article count

RT Whenever you need/want to display the number of articles of any site structure level next to the name of the category, the script does it.

This is the quick and dirty solution! (Simple tag solution: Article counter)
This is the original NAV_LIST_UL of flip-flop that was incorporated by OG and now extended by –> easily add the number of articles within a certain site structure level.

The script works exactly like NAV_LIST_UL. So, you can use it with the same prominent parameters, features as usual.

Example

Example of the menu:
Company (4)
Products (37)
Staff (12)

On the other hand it needs its own quick'n-dirty replacement tag
NLU_FF_AC_QD

You're able to edit the output of the source code to your needs:
(12) or [12] or -12 or what


Just edit

// Article Count Wrapper
$acw_before = " <span>(";
$acw_after = ")</span>";


Usage:

{NLU_FF_AC_QD:F,5,,count_articles,active}


Parent lift:

{NLU_FF_AC_QD:FP,4,2,act_path,active}


Inline PHP:

[PHP]
if(isset($GLOBALS['LEVEL_ID'][1])) {
   $level_id = $GLOBALS['LEVEL_ID'][1];
   echo '<div class="my_navi_with_the_number_of_articles_in_the_site_structure_level">';
   echo '{NLU_FF_AC_QD:,'.$level_id.',1,act_path,active}';
   echo '</div>';
}
[/PHP]


For those who are interested why I chose this name:
- NLU = NAV_LIST_UL
- FF = flip-flop
- AC = article count
- QD = quick and dirty

Limitation

<note> Limitations: There's one limitation only. The script only counts the number of articles which are in exactly the same site structure level that appears in the menu. There's no summation (unfolded) over all. Articles in sub-categories are ignored (in that way)! </note>

Example: Products (1 article)

  • Product_A (17 articles)
  • Product_B (3 articles)

Output:
Products (1)
Product_A (17)
Product_B (3)

YOU WON'T GET:

  • Products (21) (know what i mean?)





Version


english/phpwcms_replacer_rts/frontend_render/nav_list_ul-article-count.txt · Last modified: 2018/06/03 18:09 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0