Inbuilt 'Extra' field of core News module not working

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
neuroboy
Forum Members
Forum Members
Posts: 13
Joined: Sun Dec 02, 2007 4:10 am

Inbuilt 'Extra' field of core News module not working

Post 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!
Last edited by neuroboy on Mon Jan 05, 2009 3:44 pm, edited 1 time in total.
neuroboy
Forum Members
Forum Members
Posts: 13
Joined: Sun Dec 02, 2007 4:10 am

Re: Inbuilt 'Extra' field of core News module not working

Post 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?
Aleksi
New Member
New Member
Posts: 9
Joined: Mon Jan 26, 2009 8:04 pm

Re: Inbuilt 'Extra' field of core News module not working

Post 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
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: Inbuilt 'Extra' field of core News module not working

Post by RonnyK »

I will report this one in the Forge....

Ronny
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: Inbuilt 'Extra' field of core News module not working

Post 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
Aleksi
New Member
New Member
Posts: 9
Joined: Mon Jan 26, 2009 8:04 pm

Re: Inbuilt 'Extra' field of core News module not working

Post by Aleksi »

Thanks ronny, have to see if that works.
User avatar
forest-guy
Forum Members
Forum Members
Posts: 32
Joined: Fri Jan 23, 2009 11:10 pm
Location: Albuquerque, New Mexico, USA

Re: Inbuilt 'Extra' field of core News module not working

Post 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.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: Inbuilt 'Extra' field of core News module not working

Post 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
User avatar
forest-guy
Forum Members
Forum Members
Posts: 32
Joined: Fri Jan 23, 2009 11:10 pm
Location: Albuquerque, New Mexico, USA

Re: Inbuilt 'Extra' field of core News module not working

Post 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
Last edited by forest-guy on Thu Feb 12, 2009 6:25 am, edited 1 time in total.
Post Reply

Return to “Modules/Add-Ons”