Page 1 of 1

Accessing news module article title in user defined tag

Posted: Mon Mar 26, 2007 11:02 am
by lampsie
Hi guys,

Having a lot of trouble trying to get my head around this, so any assistance you might have would be greatly appreciated!

I am implementing a third party rate-this-article tool to the news section on my site, however I am having trouble accessing the news article title from my user defined tag (need to do this so I can write the article title and its rating to a flat file). The following does not work (no errors, just outputs blank string), could anyone let me know where I am going wrong?

Code: Select all

global $gCms;
$module =& $gCms->modules['News']['object'];
$ratingtitle= $module->news_title;
echo show_rating($ratingtitle,5);
Thanks,
lampsie

Re: Accessing news module article title in user defined tag

Posted: Mon Mar 26, 2007 11:07 am
by RonnyK
Have you tried this logic to pull the news_title:

http://forum.cmsmadesimple.org/index.ph ... l#msg50175

Ronny

Re: Accessing news module article title in user defined tag

Posted: Mon Mar 26, 2007 11:25 am
by lampsie
Hi Ronny,

Thx for suggestion - yup that was my main logic source (as per the code I have in the tag) - tried following it exactly, but it didn't seem to help me :(
PS I'm on CMSMS 1.0.4

A

Re: Accessing news module article title in user defined tag

Posted: Mon Mar 26, 2007 11:28 am
by lampsie
Success!

Thanks ronny - your post prompted me to re-follow the steps again, and I spotted where I went wrong:

I had:
$this->title = $row['news_title'];

Should have been...
$this->news_title = $row['news_title'];

in news.action.php

Many thanks!
Lampsie

Re: Accessing news module article title in user defined tag

Posted: Mon Mar 26, 2007 11:44 am
by lampsie
Hi guys,

Following on from my attempt to get rank-this-page third party php script working, I'm now a little stuck with AJAX posting from within the script...

The post action, after following the above, replaces ampersands with "&" in the query string, which the receiving script then cannot understand.

How do I prevent User Defined Tags etc. from parsing ampersand symbols?

Thanks,
lampsie