RSS Block
Permalink 3 users found helpfulFor example, if an RSS post had a summary including something like this:
"...check outhttp://www.concrete5.org for an excellent CMS solution..."
The RSS displayer block displays the following:
"...check out [Link] for an excellent CMS solution..."
I want the original hyperlink to carry over so viewers of my site can click the link in the RSS block to jump over to that link's source. Thank you.
"...check out <a href = "www.concrete5.org">Concrete5</a> for an excellent CMS solution..."
Is that possible? Note, my RSS feed also is distributed via an emailing list, so I want links to display correctly to my recipients there, too. Thanks.
I believe this is the code to edit (same file to edit - blocks/rss_displayer/view.php) as the description is being filtered with PHP to make it just text i.e. it's stripping the tags:
<div class="rssItemSummary"> <?php if( $rssObj->showSummary ){ echo $textHelper->shortText( strip_tags($item->get_description()) ); } ?> </div>
Try changing it to this:
<div class="rssItemSummary"> <?php $htmlrss = $item->get_description(); if( $rssObj->showSummary ){ echo $htmlrss; } ?> </div>
That should mean HTML is placed into your description area and links should appear. However, I'm unsure how that will look in plain-text emails...
You can do all sorts of filtering and replacing of things on that variable $htmlrss above. There's an automatic read more link back to the RSS article at the end for example that you might not want by the sounds of things, so try using str_replace() to remove it and mess around with other things.
Cheers
To see what I mean, you can check out my site at:
http://www.allnationsbiblefellowship.org/...
Sorry for the late reply, I wasn't getting any emails saying there had been a response.
I can see in your HTML that there are a load of <br /> tags in your RSS feed:
<div class="rssItemSummary"> We have been working hard to update our sermon database. A large <br> amount of messages from the last couple years are now available on our <br> website! If you have an iPod, you can subscribe to the podcast <br> through the link to iTunes. You can also simply listen to the sermons <br> on the website, or download them as .mp3 files. <a href="http://www.allnationsbiblefellowship.org/sermons" rel="nofollow" target="_blank">[link]</a> </div>
The reason they weren't there before is that there was a html tag filter stripping it out. You could try using str_replace on $htmlrss to remove all <br /> tags and maybe replace them with a space ( ). Like this:
<div class="rssItemSummary"> <?php $htmlrss = $item->get_description(); $htmlrss = str_replace("<br>", " ", $htmlrss); if( $rssObj->showSummary ){ echo $htmlrss; } ?> </div>
Hope that helps
/concrete/blocks/rss_displayer
to:
/blocks/rss_displayer
and change this:
to this:
Obviously you need to put in the url of your feed above. If you don't have one, take a look at this page where Franz suggests how to add one:
http://www.concrete5.org/community/forums/customizing_c5/how_to_cre...
Hope that helps