- Posts: 1
COMMUNITY FORUM
Word limit for Feed Item Title?
- shiro
- Topic Author
- Offline
- New Member
first i like to say, that th rss moodul is avery nice module!!! can you please tell me, how i can set a word limit for the feed title?
thx
shiro
Please Log in or Create an account to join the conversation.
- wager
- Offline
- Junior Member
- Posts: 20
echo substr($TitleVar,0,40).'...'
Please Log in or Create an account to join the conversation.
- spora
- Offline
- New Member
- Posts: 1
Was unable to achieve this. Can you please pinpoint the exact variable to change. Please see the codes in the template file below:
<?php if($mainframe->getCfg('caching')): ?>
<script type="text/javascript">
//<![CDATA[
document.write('\
<style type="text/css" media="all">\
@import "<?php echo $filePath; ?>/css/style.css";\
</style>\
');
//]]>
</script>
<?php else: ?>
<?php $document->addStyleSheet($filePath.'/css/style.css'); ?>
<?php endif; ?>
<div class="srfrContainer <?php echo $moduleclass_sfx; ?>">
<?php if($feedsBlockPreText): ?>
<p class="srfrPreText"><?php echo $feedsBlockPreText; ?></p>
<?php endif; ?>
<ul class="srfrList">
<?php foreach($output as $key=>$feed): ?>
<li class="srfrRow<?php echo $key%2; ?>">
<?php if($feedItemTitle): ?>
<h3><a target="_blank" href="<?php echo $feed->itemLink; ?>"><?php echo $feed->itemTitle; ?></a></h3>
<?php endif; ?>
<?php if($feedTitle): ?>
<span class="srfrFeedSource"<?php if($feedFavicon && $feed->feedFavicon) echo ' style="display:block;padding:2px 0 2px 20px;background:url('.$feed->feedFavicon.') no-repeat 0 50%;"'; ?>>
<a target="_blank" href="<?php echo $feed->siteURL; ?>"><?php echo $feed->feedTitle; ?></a>
</span>
<?php endif; ?>
<?php if($feedItemDate): ?>
<span class="srfrFeedItemDate"><?php echo $feed->itemDate; ?></span>
<?php endif; ?>
<?php if($feedItemDescription || $feed->feedImageSrc): ?>
<p>
<?php if($feed->feedImageSrc): ?>
<a target="_blank" href="<?php echo $feed->itemLink; ?>">
<img class="srfrImage" src="<?php echo $feed->feedImageSrc; ?>" alt="<?php echo $feed->itemTitle; ?>" />
</a>
<?php endif; ?>
<?php if($feedItemDescription): ?>
<?php echo $feed->itemDescription; ?>
<?php endif; ?>
</p>
<?php endif; ?>
<?php if($feedItemReadMore): ?>
<span class="srfrReadMore">
<a target="_blank" href="<?php echo $feed->itemLink; ?>"><?php echo JText::_('Read more...'); ?></a>
</span>
<?php endif; ?>
<span class="clr"></span>
</li>
<?php endforeach; ?>
</ul>
<?php if($feedsBlockPostText): ?>
<p class="srfrPostText"><?php echo $feedsBlockPostText; ?></p>
<?php endif; ?>
<?php if($feedsBlockPostLink): ?>
<p class="srfrPostTextLink"><a href="<?php echo $feedsBlockPostLinkURL; ?>"><?php echo $feedsBlockPostLinkTitle; ?></a></p>
<?php endif; ?>
</div>
<div class="clr"></div>
Please Log in or Create an account to join the conversation.
- innocence
- Offline
- New Member
- Posts: 16
Worked for me modifying the code at "\modules\mod_jw_srfr\tmpl\compact\default.php" (in case you use "compact" template) at line 50 (aprox). Look for something similar to this and replace with:
<a target="_blank" href="<?php echo $feed->itemLink; ?>">
<?php if($feedItemTitle): ?>
<?php echo substr($feed->itemTitle,0,40).'...' ?>
<?php endif; ?>
</a>
Where "40" is the limit in characters.
Hope this helps.
Please Log in or Create an account to join the conversation.