Page 1 of 1

RSS <description> not displaying hyperlink.

Posted: Wed Feb 21, 2007 1:44 pm
by blepoxp
Hello,

Could anyone tell me why this isn't working?

Code: Select all

<description><a href=\"$link\">Please click here for the full article.</a></description>
The above code would output the text without a link, but the source code of the page looks normal:

Code: Select all

<description><a href="/index.cfm?PgType=2&ArticleID=479">Please click here if you like cupcakes</a></description>
Thanks!

Posted: Wed Feb 21, 2007 1:51 pm
by feyd
If memory serves, there is no anchor tag in the RSS standard. The message should be passed through htmlentities. However what you are doing is handled elsewhere by the standard already via the <link> tag. Some feeds use <!CDATA[...]]> sections too (although for content mostly.)

Posted: Wed Feb 21, 2007 1:56 pm
by blepoxp
Thanks.
I've noticed that the <link> tag adds the "Read Complete Article" here to the description. Do you know of any way to change what that text says? I would like to customize it.

BTW, my link variable that I had wrapped in the anchor had the htmlentities:

Code: Select all

$link = htmlentities('/index.cfm?PgType=2&ArticleID=' . $line['ArticleID']);
Is it just not possible to customize the link text?

Posted: Wed Feb 21, 2007 2:15 pm
by blepoxp
The following code, which succesfully created multiple links within the description tag worked but I can't seem to adapt it to what I need because of my lack of experience with PHP. I think it's got to do with my syntax.

Code: Select all

$output .="<pubDate>{$row['Created']}</pubDate> \n
                                    <description><p>{$row['ShortBlurb']}</p><ul>";
                                foreach ($cache2 as $row2)
 { if ($row2['Doc_ResID'] == $row['Res_ID'])
     {$output .= "<li><a href=\"\uploads\old".substr($row2['Doc_Location'], 25)."\">".$row2['Doc_Title']."</a></li>";}
                                     
                       		  		
			   }$output .="</ul></description>
Any ideas?