news module ignore a different detailtemplate

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

news module ignore a different detailtemplate

Post by giapippo »

Hello
I am creating a website with version 1.11.13
I have already created other sites but with previous versions
Now I have a problem with the news module

if you want to use a different template detail than the default
the system ignores my request and uses the default detail template

I use this code

{news category="articolo" summarytemplate="articolo_blog" detailtemplate="articolodettaglio" detailpage="notizie"}

I do not understand

thanks for your help
bye
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3484
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: news module ignore a different detailtemplate

Post by velden »

Could you try to disable pretty urls (in config.php) and check if it works.

Modules can't pass all parameters when using pretty urls.
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: news module ignore a different detailtemplate

Post by giapippo »

thanks the problem are pretty urls

but the pretty url are required for seo and other links

there is a solution?

Thanks for your help
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3484
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: news module ignore a different detailtemplate

Post by velden »

You might take a look at the CGExtensions module's Smarty AddOn:
{cge_module_hint module=string ...}

This function plugin can be used to provide hints for module behavior if various parameters cannot be specified on the URL. I.e: In a situation when a site is configured to use pretty urls for SEO purposes it is often impossible to provide additional module parameters like a detailtemplate or sort order on a URL. This plugin can be used in page templates, GCBs or in a page specific way to give hints as to how modules should behave.

Note: Any parameters that are specified on the URL will override matching module hints. i.e: When using News and a detailtemplate parameter is specified on a News detail url, any detailtemplate hints will have no effect.

Note: In order to ensure proper behavior, module hints must be created before the {content} tag is executed in the CMSMS page template. Therefore they should (normally) be created very early in the page template process. An ideal location for page specifc hints is in the "Smarty data or logic that is specific to this page:" textarea on the editcontent form.
Example:

When using the CGBlog module, and pretty urls. You wish to display blog articles for a specific category on one page, and would like to use a non standard detail template to display the individual articles on a differernt page. I.e: perhaps on your "Sports" page you are calling CGBlog like: {CGBlog category=sports detailpage=sports_detail}. However, using pretty urls it is impossible to specify a detailtemplate on the links that will generate the detail views. The solution is to use the {cge_module_hint} tag on the sports_detail page to provide some hints as to how CGBlog should behave on that page.

When editing the sports_detail page on the options tab, in the textarea entitled "Smarty data or logic that is specific to this page:" you could enter a tag such as: {cge_module_hint module=CGBlog detailtemplate=sports}. Now when a user clicks on a link from the CGBlog display on your "sports" page he will be directed to the sports_detail page, and the CGBlog detail template entitled "sports" will be used to display the article.

It is possible to specify multiple parameter hints to a single module in one call to this plugin.
It is possible to call this module multiple times in a request to provide hints to different modules.

Usage:

{cge_module_hint module=CGBlog summarytemplate=something detailpage=home}
{cge_module_hint module=CGSmartImage noembed=1}

{cgerror [errorclass=string]}...{/cgerror}
Never used it myself though.
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: news module ignore a different detailtemplate

Post by giapippo »

Thanks
but I do not understand why a basic form that has always worked well can have such a heavy defect

Thanks for your help
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

Re: news module ignore a different detailtemplate

Post by paulbaker »

giapippo wrote:but I do not understand
Pretty URLs link: domain.com/news-article-about-weather

Default URLs include parameters for article number, templates to use etc. More flexible.

By the way, version 1.11.13 is not the latest. When developing a new site you should use the latest version of the core code, currently 1.12.1 (if you need access to old modules) or 2.1.2.
To copy System Information to the forum:
https://docs.cmsmadesimple.org/troubles ... nformation

CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: news module ignore a different detailtemplate

Post by giapippo »

hello
I upgraded to version 1.12.1
but it still does not work
absurd
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: news module ignore a different detailtemplate

Post by giapippo »

you know what the latest version of the series 1 CMSMS where the news module works?
thanks
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3484
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: news module ignore a different detailtemplate

Post by velden »

It probably never did work like you want it to work now. Though I'm not 100% sure.

But test thoroughly on older versions whether you're doing the exact same thing.
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm
Location: MI

Re: news module ignore a different detailtemplate

Post by Jeff »

It isn't a bug or defect. I has been stated in the Help section as long as I know.
Post Reply

Return to “Modules/Add-Ons”