BC Tech : Free Tutorials and More Advertisement
Main
Friday, 30 July 2010
 
 
Change RSS Link Formatting in Joomla Print E-mail
Tutorials / FAQs - Joomla

Sometimes it may be necessary to change the way your RSS links are displayed, in order to preserve attractive formatting. There is no way to do this in the standard Joomla install, but that's where this tutorial comes in.

This change will still output the correct hyperlinks for your news feeds, but will cut the display off at 50 characters to preserve formatting.

Find this original code in "/components/com_newsfeeds/newsfeeds.html.php"

Original Code
  1. <?php
  2. if ( $params->get( 'link' ) ) {
  3.   ?>
  4.   <td width="50%" class="<?php echo $tabclass[$k]; ?>">
  5.   <?php echo ampReplace( $row->link ); ?>
  6.   </td>
  7.   <?php
  8. }
  9. ?>

 

Replace with this updated code. I have made this a hyperlink because the truncated text is useless by itself.

New Code
  1. <?php
  2. if ( $params->get( 'link' ) ) {
  3. ?>
  4.   <td width="50%" class="<?php echo $tabclass[$k]; ?>">
  5.     <a href="<?php echo ampReplace( $row->link ); ?>" class="category<?php echo $params->get( 'pageclass_sfx' ); ?>">
  6.       <?php printf("%.50s\n", ampReplace( $row->link )); ?>
  7.     </a>
  8.   </td>
  9. <?php
  10. }
  11. ?>

 

Now just upload the modified file to your webserver and take a look at your accomplishments.

 
< Prev   Next >
Google
 
Web benconley.net
 
Top! Top!