Page 1 of 1

News module taking category from menu text?

Posted: Tue May 02, 2006 11:05 am
by tristan
Hi there,

I'm looking for a way to have the news module take the category from the menu text of that page. This would be really nice because this way I can still have one template for all the pages because I want each page to have a different news category. I'm  trying to do this:

Code: Select all

{cms_module module="news" category="{menu_text}"}
This however, obviously, doesn't work. Does anyone over here have a simple solution for this problem?

Kind regards,

Tristan

Re: News module taking category from menu text?

Posted: Wed May 03, 2006 1:31 am
by calguy1000
use the get_template_vars plugin (describe elsewhare in the forum) to see if the current menu text is exported as a variable.  if it is, then you should be able to do a:

Code: Select all

{cms_module module="news" category="$variable"}

Re: News module taking category from menu text?

Posted: Thu Jun 01, 2006 11:25 am
by mikemee
Depending on your scenario, a value of $page works pretty well.  E.g. see http://forum.cmsmadesimple.org/http://p ... 664#p27664.

Re: News module taking category from menu text?

Posted: Mon Jun 05, 2006 12:24 am
by FinnK
Why not make different (normal) pages with the news module displaying news from different categories - and naming the pages and menutexts accordingly?
- am I missing something?