Page 1 of 1
Inbuilt 'Extra' field of core News module not working
Posted: Mon Jan 05, 2009 2:43 pm
by neuroboy
Hi
I'm using CMS Version 1.5.1 and I can't seem to get the 'Extra' field built into the News module to work.
I want my CMS users to use this to add URLs, but whatever is put into the field is not added to the news details, even though I've left the default code for it in my detail template, as follows:
Code: Select all
{if $entry->extra}
<div id="NewsPostDetailExtra">
{$extra_label} {$entry->extra}
</div>
{/if}
I've also tried the above without the {if...}, but it still doesn't show anything.
The information entered is definitely saved to the database as the field appears pre-filled when you go to edit the news item again.
Any ideas? I know I can probably just set up a custom field to do this, but would rather just use what is there. What is the Extra field actually for?
If I can't get it to work I'll just hack the form to disable/hide it and remove the code from my template.
Oh, I've changed the label in the news language file to say 'Web URL' instead of 'Extra' - but that's just the label on the form, isn't it?
cheers!
Re: Inbuilt 'Extra' field of core News module not working
Posted: Tue Jan 06, 2009 3:09 pm
by neuroboy
Please can I ask why my request has been moved from the Product Support forum to the Community Modules forum?
The sticky in the Product Support forum says:
"If you are having problems with CMS Made Simple or one of the core modules that come with it this is the right place to ask..."
http://forum.cmsmadesimple.org/index.ph ... 335.0.html
I am requesting help with the core News Module that is supplied with the CMSMS download, so is it not more relevant for my post to stay where it was, where it can be answered by a developer?
Re: Inbuilt 'Extra' field of core News module not working
Posted: Mon Jan 26, 2009 8:07 pm
by Aleksi
I'm also interested what goes wrong here. It seem to work ok in summary template, but not at all with detail template. Any help would be highly appreciated.
Aleksi
Re: Inbuilt 'Extra' field of core News module not working
Posted: Mon Jan 26, 2009 8:28 pm
by RonnyK
I will report this one in the Forge....
Ronny
Re: Inbuilt 'Extra' field of core News module not working
Posted: Mon Jan 26, 2009 8:51 pm
by RonnyK
OK, I posted the bug in the forge.
You could try adding.
$onerow->extra = $row['news_extra'];
at line 68 of action.detail.php in News.
Ronny
Re: Inbuilt 'Extra' field of core News module not working
Posted: Tue Jan 27, 2009 6:06 am
by Aleksi
Thanks ronny, have to see if that works.
Re: Inbuilt 'Extra' field of core News module not working
Posted: Thu Feb 12, 2009 5:46 am
by forest-guy
Ronny I too am having the same issue as neuroboy. (CMS 1.5.2 with News 2.9.2)
The {$entry->extra} field shows just fine in the summary - but has no value in the detail.
I did make the modification you recommended to action.detail.php (by the way are there supposed to be two lines at about line 65 that say
$onerow->postdate = $row['news_date'];?)
Even with the modification no values for {$extra_label} or {$entry->extra} are showing up in the detail default template.
I looked in the forge to see if there was any progress on the bug entry (
http://dev.cmsmadesimple.org/projects/newsmodule) but couldn't find it. I'm not sure I'm looking in the right spot since the version number at the above link says the latest release is 2.8.3.
Re: Inbuilt 'Extra' field of core News module not working
Posted: Thu Feb 12, 2009 5:57 am
by RonnyK
My lines 67-71 now show:
Code: Select all
$onerow->category = $row['news_category_name'];
$onerow->extra = $row['news_extra'];
//
// Handle the custom fields
The Forge entry, was:
http://dev.cmsmadesimple.org/bug/view/2941
Make sure that your detail template of News, uses the field...
Code: Select all
{if $entry->extra}
<div id="NewsPostDetailExtra">
{$extra_label} {$entry->extra}
</div>
{/if}
Ronny
Re: Inbuilt 'Extra' field of core News module not working
Posted: Thu Feb 12, 2009 6:10 am
by forest-guy
Yep the details template has those lines exactly.
Look a few more lines up in the action.detail.php - my original shows:
$onerow->title = $row['news_title'];
$onerow->content = $row['news_data'];
$onerow->summary = $row['summary'];
$onerow->postdate = $row['news_date'];
$onerow->postdate = $row['news_date'];
$onerow->startdate = $row['start_time'];
$onerow->enddate = $row['end_time'];
$onerow->category = $row['news_category_name'];
I have added the following line after the last one listed above:
$onerow->extra = $row['news_extra'];
UPDATE: I went back and checked everything - terminated all my browsers and started everything back up again. And now it works. Thanks Ronny.
Thanks