Hi everybody,
a have a template in which I have 3 news modules, with 3 categories and 3 different templates.
It is...
{cms_module module='news' number='5' category='category1' summarytemplate='new1.tpl' detailtemplate='dnew1.tpl'}
{cms_module module='news' number='7' category='category2' summarytemplate='new2.tpl' detailtemplate='dnew2.tpl'}
{cms_module module='news' number='4' category='category3' summarytemplate='new2.tpl' detailtemplate='dnew3.tpl'}
I would like to change the "number" to show, but with a variable, so it can change deppending on some event...
Well, the question is:
How can I do that??
Thanks!!
Give parameters to the news module Topic is solved
Re: Give parameters to the news module
Dont know if it will work but have you tried this
Dont forget to switch on Smarty plugins in config.php
Or this
Code: Select all
{cms_module module='news' number='{php}$number{/php}' category='category1' summarytemplate='new1.tpl' detailtemplate='dnew1.tpl'}
Or this
Code: Select all
{cms_module module='news' number='{userdefined_tag}' category='category1' summarytemplate='new1.tpl' detailtemplate='dnew1.tpl'}
Re: Give parameters to the news module
I tried what you suggested, but it doesn't work...
It should be a way, but I can't find it!
It should be a way, but I can't find it!
Re: Give parameters to the news module
Have you defined $number or {userdefined_tag} before?
Re: Give parameters to the news module
You could use the expiration date at the bottom and not have to use the numbers in the tag.
Make the article to have a start and end date and it will show up then go away after it expires.
Make the article to have a start and end date and it will show up then go away after it expires.
Re: Give parameters to the news module
Create a User Defined Tag (UDT) with your event handler. Assign the numbers to smarty variables:
Insert the UDT where you need it.
Code: Select all
Global $gCms;
...
$gCms->smarty->assign('number1' , 5 );
$gCms->smarty->assign('number2' , 7 );
$gCms->smarty->assign('number3' , 4 );
Code: Select all
{your_UDT}
{cms_module module='news' number=$number1 ...}
{cms_module module='news' number=$number2 ...}
{cms_module module='news' number=$number3 ...}
Last edited by mahjong on Thu Sep 14, 2006 2:39 pm, edited 1 time in total.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Give parameters to the news module
Or.... entirely in smarty:
Code: Select all
{assign var=number1 value="5"}
{assign var=number2 value="7"}
{assign var=number3 value="4"}
{cms_module module=news number=$number1 ...}
{cms_module module=news number=$number2 ...}
{cms_module module=news number=$number3 ...}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.