Page 1 of 1
News module - detailtemplate="sometemplate.tpl" problem
Posted: Thu May 11, 2006 4:40 pm
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
Re: News module - detailtemplate="sometemplate.tpl" problem
Posted: Thu May 11, 2006 4:46 pm
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
Re: News module - detailtemplate="sometemplate.tpl" problem
Posted: Fri May 12, 2006 10:33 am
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
Re: News module - detailtemplate="sometemplate.tpl" problem
Posted: Fri May 12, 2006 11:54 am
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.
Re: News module - detailtemplate="sometemplate.tpl" problem
Posted: Fri May 12, 2006 4:59 pm
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!
Re: News module - detailtemplate="sometemplate.tpl" problem
Posted: Sun May 14, 2006 12:07 pm
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.

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
Re: News module - detailtemplate="sometemplate.tpl" problem
Posted: Sun May 14, 2006 1:04 pm
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;
Re: News module - detailtemplate="sometemplate.tpl" problem
Posted: Sun May 14, 2006 2:35 pm
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