Problem with News Detail Templates

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
sponna1
Forum Members
Forum Members
Posts: 43
Joined: Thu Oct 17, 2013 9:25 am

Problem with News Detail Templates

Post 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
applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am
Location: London

Re: Problem with News Detail Templates

Post 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}
sponna1
Forum Members
Forum Members
Posts: 43
Joined: Thu Oct 17, 2013 9:25 am

Re: Problem with News Detail Templates

Post by sponna1 »

That's great thanks I will give that a try.

Thanks for your help

Vanessa
Zoorlat

Re: Problem with News Detail Templates

Post 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)
User avatar
Tetsuo
Forum Members
Forum Members
Posts: 58
Joined: Wed Aug 19, 2009 12:00 pm
Location: UK

Re: Problem with News Detail Templates

Post 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.
Post Reply

Return to “Modules/Add-Ons”