CMS Made Simple Forums
https://forum.cmsmadesimple.org/

news browsecat by $node.PARAM
https://forum.cmsmadesimple.org/viewtopic.php?f=4&t=75444
Page 1 of 1

Author:  pWorker [ Mon Sep 19, 2016 9:02 am ]
Post subject:  news browsecat by $node.PARAM

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:
      .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:
{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:
{news action="browsecat" browsecattemplate="browsecat-test"}
within your page.

Hope that helps anybody ,mfg

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/