Putting page title inside news tag

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
andyoniyatte

Putting page title inside news tag

Post 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
Pierre M.

Re: Putting page title inside news tag

Post 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.
andyoniyatte

Re: Putting page title inside news tag

Post 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--
Pierre M.

Re: Putting page title inside news tag

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Putting page title inside news tag

Post by calguy1000 »

{capture assign='mytitle'}{title}{/capture}
{news category="$mytitle"}
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.
andyoniyatte

Re: Putting page title inside news tag

Post by andyoniyatte »

Beautiful! Thanks so much, both of you!

A--
Locked

Return to “CMSMS Core”