Page 1 of 1

Putting page title inside news tag

Posted: Sat Mar 15, 2008 8:45 pm
by andyoniyatte
Hi,

I'm a complete newbie at this, so I apologize in advance if this is a stupid question. I'm running CMSms 1.2.3, and this only involves the built-in news module.

Basically here's what I've got going on. I'd like to show only the news items in the category that matches the page title. So, for example, if the page title is "Test Page," I'd like the {news} tag to only generate those news articles that are in the "Test Page" category.

Is this at all possible?

Thanks so much for your help!

Aaron

Re: Putting page title inside news tag

Posted: Mon Mar 17, 2008 12:41 pm
by Pierre M.
Hello,

please read the help of the {news...} tag call in the tag/module manager (in the admin) to learn how to use its category and so parameters.

Pierre M.

Re: Putting page title inside news tag

Posted: Mon Mar 17, 2008 1:04 pm
by andyoniyatte
Thank you for your reply. I'm sorry, I should have been clearer: is there any way to supply the category parameter dynamically?

So that I can use one template to display news from any category, based on the title of the page.

Thanks!

A--

Re: Putting page title inside news tag

Posted: Mon Mar 17, 2008 1:42 pm
by Pierre M.
It shouldn't be difficult :
-the title you want is in {title} so what about trying {news parameter=$title} ? (I'm not sure about this)
-or search the forum (with google) with these keywords : assign, capture, page alias, smarty, parameter...

Pierre M.

Re: Putting page title inside news tag

Posted: Mon Mar 17, 2008 2:08 pm
by calguy1000
{capture assign='mytitle'}{title}{/capture}
{news category="$mytitle"}

Re: Putting page title inside news tag

Posted: Mon Mar 17, 2008 2:20 pm
by andyoniyatte
Beautiful! Thanks so much, both of you!

A--