News Categories Question

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.
Post Reply
malarky_moose
New Member
New Member
Posts: 3
Joined: Thu May 01, 2008 3:32 am

News Categories Question

Post by malarky_moose »

I'm new to this, and I'm not even too sure this is the right part of the BB to post in, but...


I'm wondering if there is a way to assign different templates to different categories? for example if there were 3 categories of news: world, local, celebrity gossip; could i assign a unique template to each? currently i am using "{news browsecat="1" detailpage='News'}", but that assigns one template for all categories. i've searched the forums, but haven't come up with much... any help is apreciated.
User avatar
relic
Forum Members
Forum Members
Posts: 34
Joined: Fri Dec 08, 2006 9:59 am
Location: New Zealand

Re: News Categories Question

Post by relic »

hi there,

just put this in your page:

Code: Select all

{news number='8' summarytemplate="templatename" 
                      category="catname" detailpage="blah blah"}
hope that helps

dave
malarky_moose
New Member
New Member
Posts: 3
Joined: Thu May 01, 2008 3:32 am

Re: News Categories Question

Post by malarky_moose »

thanks for the reply.
maybe there is some way to use a variable within the parameter? for example:

Code: Select all

{news number='8' detailpage="$node.news_category_name"}
i'm no programmer, but it would be helpful to know if this is even possible or i should just give up. would be nice if it worked!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: News Categories Question

Post by calguy1000 »

hmmm, I've looked at this and it's possible, but it is not a simple task.

I'd do it with a new browsecat template in the News module, and use the module_action_link plugin out of CGSimpleSmarty.

I'd start by changing this text in the template:

Code: Select all

{if $node.count > 0}
	<a href="{$node.url}">{$node.news_category_name}</a> ({$node.count}){else}<span>{$node.news_category_name} (0)</span>{/if}
to

Code: Select all

{if $node.count > 0}
   {module_action_link module='News' action='summary' category=$node.news_category_name summarytemplate=$node.news_category_name}
{/if}
That'll require you to setup a summary template with the same name as the category name.
You can play with the parameters from there.
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.
malarky_moose
New Member
New Member
Posts: 3
Joined: Thu May 01, 2008 3:32 am

Re: News Categories Question

Post by malarky_moose »

wow. this might be a little over my head. i'd figured on the template and category names being the same. but i don't know what a plugin is or how to use it... is it just a file that i upload somewhere? is it free? thanks for your thoughtful reply. perhaps there is a way to link to specific pages instead? basically i want a viewer to be able to click on one of the summaries, and if the category is, say, celebrity gossip, then items in the sidebar would reflect that, and if the category is world news, then the sidebar would reflect that instead. well i hope i'm making sense anyways. thanks again.
Post Reply

Return to “CMSMS Core”