Forums / Cotonti / Support / news post templates

fraze
#1 2012-06-10 22:09

another question, and one which is busting my nuts a bit...

i've created a new category so certain news posts will look different and created a new tpl file called news.psnews.tpl.  according to the page it says it needs to be put in a folder within my theme called PLugins, which ive done.  however the news is still using the default template...ive also tried putting the new tpl in the same folder as the default tpl file in the new plugin but no dice.

heres what the site installation shows:

www.steel-dragon.co.uk/inibeta/stuff/news1.jpg

www.steel-dragon.co.uk/inibeta/stuff/news2.jpg

any ideas?

Eugene
#2 2012-06-11 06:51

hello.

did you added that new category "psnews" in the config of News plugin? Are you using {INDEX_NEWS_PSNEWS} in index.tpl and see default tpl (news.tpl)?

fraze
#3 2012-06-11 09:31

nope, stupidly I completely missed that...it's not possible to have all the news in 1 feed and the posts just style according to the categories then...that would be better than having to have 2 feeds from the 2 tags.

pieter
#4 2012-06-11 12:11

All subcats from news are displayed with {INDEX_NEWS}
But for me it is not possible to give them a different style.
The only thing you can do is using an if structure in news.tpl and use a link to the category with {PHP.????} and link to an extra css

Different style sheets is only for pages, not news.
Put for the page you need to use page.CAT.tpl.

Maybe someone can correct me if I'm wrong.

... can we help you ...
elfrenazo
#5 2012-06-11 17:22

create categories like subcateroias and solving the problem, would be my solution.

Kingsley
#6 2012-06-11 17:28

And (although I do not know if this will solve our problem) you can set a Custom category code in the option of given category. In theory this could set a different tpl for your needs. (maybe Trust can shine a light on that).

Trustmaster
#7 2012-06-13 20:40

You may go hardcore and use IF statements to apply different styles on posts from different categories, e.g.:

<!-- IF {PAGE_ROW_CAT} == 'foo' -->
<div class="foober">
...
</div>
<!-- ENDIF -->
<!-- IF {PAGE_ROW_CAT} == 'bar' -->
<div class="barber">
...
</div>
<!-- ENDIF -->

This solution is ok if there aren't many categories of course.

May the Source be with you!
fraze
#8 2012-06-13 21:52

perfect!