Page 1 of 1

Problem with News Detail Templates

Posted: Mon Jun 02, 2014 5:24 pm
by sponna1
Hi,

I have set up two sets of templates (summary and detail) in the news module. This is so for standard news items I can call my news template but for testimonials (which I want to add via news) I can call a separate template.

This is working fine for the summary templates the two calls I have for the articles into the page are

Code: Select all

{news number='10' category='Testimonials' summarytemplate="cwstestimonial" detailtemplate="cwstestimonial"}
http://www.veecreate.co.uk/clients/cmsm ... nials.html

and

Code: Select all

{news number='10' category='General' summarytemplate="cwsnews" detailtemplate="cwsnews"} 
http://www.veecreate.co.uk/clients/cmsm ... /news.html

However the detail template always calls in the detail template default setting.
Am I missing something really simple please? Anyone give me a clue as to how I can fix this.
The site is running with Pretty URLS could this be causing this issue?
Many Thanks
Vanessa

Re: Problem with News Detail Templates

Posted: Tue Jun 03, 2014 12:54 am
by applejack
Re: The site is running with Pretty URLS could this be causing this issue?

Yes it doesn't work when using Pretty URLS. Workaround is in the detailed template use something like

Code: Select all

{if $page_alias == "news"}
page specific template style goes here
{else}
second template style goes here
{/if}

Re: Problem with News Detail Templates

Posted: Tue Jun 03, 2014 11:02 am
by sponna1
That's great thanks I will give that a try.

Thanks for your help

Vanessa

Re: Problem with News Detail Templates

Posted: Wed Jun 11, 2014 10:06 am
by Zoorlat
For your situation, perhaps an even more suitable check in the if-clause of your detail template could be:

Code: Select all

{if $entry->category == "Testimonials"}

Template for Testimonials...

{else}

Template for other (general) news.

{/if}
(sorry if I'm just pointing out the obvious)

Re: Problem with News Detail Templates

Posted: Wed Aug 27, 2014 2:19 pm
by Tetsuo
Just wanted to say thanks for this, it works. I was going crazy wondering why detailtemplate wasn't working. Feels like a bug to me, or at least it should be noted in the Help docs which it currently isn't.