Keyword

Word limit for Feed Item Title?

More
14 years 2 months ago #35192 by shiro
Word limit for Feed Item Title? was created by shiro
Hi,

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.

More
14 years 1 month ago #35193 by wager
Replied by wager on topic Re: Word limit for Feed Item Title?
Don't quote me on this but I'm not sure you can. You may go to your default.php in your template file and wrap the itemTitle in the php substr function and limit the characters. I would recommend adding ellipses at the end. So something like this
echo substr($TitleVar,0,40).'...'

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago - 13 years 4 months ago #35194 by spora
Replied by spora on topic Re: Word limit for Feed Item Title?
Please wager.

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.

More
11 years 11 months ago #35195 by innocence
Replied by innocence on topic [Solved]
I know it´s a little late  :D but I´ll leave the solution for anyone who reads this.

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.


Powered by Kunena Forum