News Module: MicroManagement Possible?

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
ostricized

News Module: MicroManagement Possible?

Post by ostricized »

Hi!

I am looking to see if anyone has done the following with News Module;

Code: Select all

{cms_module module="news" number="10" category='{title}'}
Goal: Having category specific news articles using the same template for multiple categories of news. Only way I could think to do this (I am NO programmer, I am a designer) is using the page title {title} which passes the variable(?) I need to accomplish this.

Problem: Can't seem to use {} inside {} (result {{}})

Has anyone approached this before?

Example URI: http://mm.drunkenlords.com/breaking_news/

The section that I would like to apply the example code in is the '{title} Archives' - The archives should be category specific on this page, however they are not, and all articles are displayed.
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: News Module: MicroManagement Possible?

Post by tsw »

I wouldn't use title as it may contain very long string. use page name instead like this

{cms_module module="news" number="10" category=$page_name}

ps. {get_template_vars} is a nice way to find out what variables you can use

hope this helps
ostricized

Re: News Module: MicroManagement Possible?

Post by ostricized »

tsw: thank you very much for the super quick response - I'll let you know if I get it to worky!
ostricized

Re: News Module: MicroManagement Possible?

Post by ostricized »

TSW: No such luck using $page_name. Thanks again for the support!
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: News Module: MicroManagement Possible?

Post by tsw »

works here like a charm, are you sure you named your categories right. check the page variable content with get_template_vars or look at options tab when editing content. $page_name = alias

hope this helps
ostricized

Re: News Module: MicroManagement Possible?

Post by ostricized »

I figured out the problem. The $page_name value was *NOT* the value I needed to use. It was $page_title. The reason I could not use $page_name was as follows;

$page_name = upcoming_events
$page_title = Upcoming Events

Needed title because I changed the title after I designed the page to remove the underscore (doesn't look good) and capitalize the text.

Thanks your support was the trick and enough time for me to understand.
Post Reply

Return to “Tips and Tricks”