irislines web design
irislines web design

Different “read more” text for different sections.

(Note added 3/21/2011 – This article describes how to have one component output different html for different sections of a website.  New in Joomla 1.6 is the ability to do this with named alternative  overrides that can be selected as a parameter.  I’ll be posting about that soon!)

For  the negreenhouseupdate.info site   I used the extension “Imagesized”  to have large images resized when they appear in a blog layout.   This allowed me to have photo gallery content items with large image, and lengthy “captions” appear as a page of thumbnails with read more links that display ONLY the articles title.

THEN,   we realized we wanted to have the update articles display only introductory text with read more links, but really needed the words “read more”  for it to make sense.

I was already using html overrides from beez template, and modified the php:   content/category/blog_item.php to include this:

(Note:   section id 3 is the photo gallery, where we don’t want the words “read more” )

item->params->get(’show_readmore’) && $this->item->readmore && ($this->item->sectionid == 3)) : ?>

item->readmore_link; ?>” class=”readonitem->params->get(‘pageclass_sfx’); ?>”>
item->readmore_register) :
echo JText::_(‘Register to read more…’);
elseif ($readmore = $this->item->params->get(‘readmore’)) :
echo $readmore;
else :
echo JText::sprintf($this->item->title);
endif; ?>

 

item->params->get(’show_readmore’) && $this->item->readmore && ($this->item->sectionid != 3)) : ?>

item->readmore_link; ?>” class=”readonitem->params->get(‘pageclass_sfx’); ?>”>
item->readmore_register) :
echo JText::_(‘Register to read more…’);
elseif ($readmore = $this->item->params->get(‘readmore’)) :
echo $readmore;
else :
echo JText::sprintf(‘Read more: ‘,$this->item->title);
endif; ?>

 

Tags: ,

IrisLines LLC
101 Washington Street
Brattleboro, VT 05301

802 257 7391

info@irislines.com