I have made a few changes to the marinelli/tploverrides/aggregator/aggregator-item.tpl.php file in an effort to improve html validation through the feed aggregator when sources may have incorrect html syntax.

<?php
// $Id: aggregator-item.tpl.php,v 1.1 2008/03/11 19:25:59 lioz Exp $

//Marinelli template for feed aggregator
?>


<div class="feedcontainer">
<div class="feedimage">


</div>

<div class="feedcontent">

  <h2>
    <a href="<?php print $feed_url; ?>"><?php print $feed_title; ?></a>
  </h2>

  <?php if ($source_url) : ?>
    <p class="feedinfo"><span class="sorgente"><a href="<?php print $source_url; ?>" class="feed-item-source"><?php print $source_title; ?></a></span></p>
  <?php endif; ?>
<p><?php print $source_date; ?></p>


<?php if ($content) : ?>

    <?php
	if ( substr($content,0,3) != "<p>" && substr($content,0,4) != "<ul>" ) { print "<p>"; } # NEEDS UPDATED TO INCLUDE  SKIPPINGP P TAG BEFORE TABLES AND OTHER TAGS THAT CAN'T BE WRAPPED IN A PARAGRAPH TAG
	$content=str_replace("<br>","<br />",$content);
	$content=str_replace("<p></p>","<p>&nbsp;</p>",$content);
	print $content; 
	if ( substr($content,-4) != "</p>" && strpos($content,"</p>") == FALSE ) { print "</p>"; }
	?>
<?php endif; ?>


<?php if ($categories) : ?>
   <p> <?php print t('Categories'); ?>: <?php print implode(', ', $categories); ?></p>
<?php endif ;?>

</div>

</div>

1. Added the end </p> to line 21
2. Added the begin <p> to line 23
3. Replaced line 27 with new php block

I threw this together pretty quickly so any improvements would be greatly encouraged. It seemed to fix the 3 aggregated sources I use right now syntax wise using under HTML Validator in Firefox. (Lifehacker,Slashdot and Filehippo)

Comments

oadaeh’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

This issue is being closed because it is against a branch for a version of Drupal that is no longer supported.
If you feel that this issue is still valid, feel free to re-open and update it (and any possible patch) to work with the 7.x-4.x branch.
Thank you.