news browsecat by $node.PARAM

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Locked
pWorker
Forum Members
Forum Members
Posts: 48
Joined: Wed Aug 31, 2016 1:30 pm

news browsecat by $node.PARAM

Post by pWorker »

Hey,

i`m manipulating the news module at the moment (filter- and sortfunctions will follow) and this easy trick helps to filter by the $node. values:

Code: Select all

      .news_category_id (string) = 1
      .news_category_name (string) = General
      .parent_id (string) = -1
      .hierarchy (string) = 00001
      .item_order (string) = 1
      .long_name (string) = General
      .create_date (string) = 10:59:45
      .modified_date (string) = 10:59:45
      .index (integer) = 0
      .count (integer) = 0
      .prevdepth (integer) = 1
      .depth (integer) = 1
      .url (string) = http://xxx.de
Just make a simple browsecat template {browsecat-test} and add an if-condition:

Code: Select all

{foreach from=$cats item=node}
{if $node.parent_id == 4} 
<p><a href="{$node.url}" title="{$entry->title}">{$node.news_category_name}</a></p>
{/if}
{/foreach}
and call it

Code: Select all

{news action="browsecat" browsecattemplate="browsecat-test"}
within your page.

Hope that helps anybody ,mfg
Locked

Return to “Tips and Tricks”