News module - detailtemplate="sometemplate.tpl" problem

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.
Locked
kevin360

News module - detailtemplate="sometemplate.tpl" problem

Post by kevin360 »

Just installed 0.13beta4 and am testing it, but I'm having a problem getting the detailtemplate option of the News module to work correctly.  Right now I've got a main page that has this:

{cms_module module='News' number='5' sortasc='true' category='Recurring' summarytemplate='news_recur_summ.tpl' detailtemplate='news_recur_detail.tpl'}

When I create a news article of the category 'Recurring' it displays the summay by the "news_recur_summ.tpl" file correctly.  However, when I click on the news article and go to the details it doesn't use the "news_recur_detail.tpl" file, it just uses the default detail template that is editable through the News module.  I have the detail and summary templates for "Recurring" in the correct place modules/News/templates.  Not sure if this is a bug or I'm doing something incorrectly.  Anyone else using the optional feature detailtemplate and it's working correctly?

Thanks,
Kevin
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: News module - detailtemplate="sometemplate.tpl" problem

Post by Dr.CSS »

only if i put just one not two in that line.... just detailtemplate or summarytemplate  not both  .tpl
sorry have no idea why... the only thing that works for me is to edit the default detail or summary template

  mark
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm
Location: Finland

Re: News module - detailtemplate="sometemplate.tpl" problem

Post by tsw »

might be a bug

when you click "more" link news module will be called again, now if this call doesnt have detailtemplate info it will show defaulttemplate

Ill test later today
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: News module - detailtemplate="sometemplate.tpl" problem

Post by Ted »

Normally, the detail template would be stored in the link.  Since the pretty url stuff is on by default, it's not in there anywhere.  I'm going to have to add it inside the pretty_url for it to work properly...  though it's going to be a little uglier.

I'll make a bug so I don't forget.
kevin360

Re: News module - detailtemplate="sometemplate.tpl" problem

Post by kevin360 »

Ah, you are correct!!  The pretty url setting causes it to not use the detailtemplate.  Ok, I can change the setting to use non-pretty urls till there is a fix for it.

Thanks!
simb
Forum Members
Forum Members
Posts: 26
Joined: Fri Apr 21, 2006 8:17 pm

Re: News module - detailtemplate="sometemplate.tpl" problem

Post by simb »

Hi all,

I stumbled over the same problem today (News 2.0.3 on CMSMS 0.12.1) and was able to fix it for me.  8)
In the help is written:
detailtemplate="sometemplate.tpl"
but in action.default.php:129 the parameter was passed "as is", which changes the double quotes to html_entities %20.

I found two way to solve it:
1.) just leave the quotes out  when calling the module or use single quotes, e.g.

Code: Select all

{cms_module module='news' number='3' dateformat="%d.%m.%Y" summarytemplate=newsbar.tpl detailtemplate=newsdetails.tpl moretext="weiter..." lang="de_DE"}
or

2.) enhance action.default.php:129 like this

Code: Select all

$sendtodetail['detailtemplate'] = str_replace('"', '', $params['detailtemplate']);

Hope this helps someone.
I post it here, as for me it seems, that the module "News" in the Forge is not up to date?! Otherwise, I would have open a bug-message to either update the help text in all languages or to change the code in action.default.php:129. Admins?

cu
simb
kevin360

Re: News module - detailtemplate="sometemplate.tpl" problem

Post by kevin360 »

Do you have pretty_urls turned on?  I tried that fix but it still didn't work.  I have this in my config.php:

$config['assume_mod_rewrite'] = true;
$config['internal_pretty_urls'] = true;
$config['use_hierarchy'] = true;
simb
Forum Members
Forum Members
Posts: 26
Joined: Fri Apr 21, 2006 8:17 pm

Re: News module - detailtemplate="sometemplate.tpl" problem

Post by simb »

kevin360 wrote: Do you have pretty_urls turned on?
No I dont have and I use the 0.12.1 version.
Sorry for the confusion.

simb
Locked

Return to “CMSMS Core”