Joomla! At front side How to open read more link in model box

Step 1:  Rename root index.php as index2.php at the index2.php write only 2 lines.

$_REQUEST[‘tmpl’] = ‘component’;
include(‘index.php’);

Step2: at your template  html\com_content\category\blog_item.php

Write below lines

JHTML::_( ‘behavior.modal’ );   // Add it after restricted access line

Step3: In the blog_item.php file after this line  at line no 125
<?php if ($this->item->params->get(‘show_readmore’) && $this->item->readmore) :

ADD this lines

// Replaced the index witrh index2 to open popup without extra js & css files
$this->item->readmore_link = str_replace(‘index’,’index2′,$this->item->readmore_link);

<a href=”<?php echo $this->item->readmore_link; ?>”     class=”readon<?php echo $this->escape($this->item->params->get(‘pageclass_sfx’)); ?> modal”>
====================================================

Finally the article div content at the blog_item.php should be like this

<div class=”article-content”>
<?php if (isset ($this->item->toc)) : ?>
<?php echo $this->item->toc; ?>
<?php endif; ?>
<?php echo $this->item->text; ?>
<?php if ($this->item->params->get(‘show_readmore’) && $this->item->readmore) :

// START:: Added for modal box view
// Replaced the index witrh index2 to open popup without extra js & css files
$this->item->readmore_link = str_replace(‘index’,’index2′,$this->item->readmore_link);

?>
<a href=”<?php echo $this->item->readmore_link; ?>  class=”readon<?php echo $this->escape($this->item->params->get(‘pageclass_sfx’)); ?> modal”>”>
<?php
// Updated link to open in popup
// END:: Added for model box view
if ($this->item->readmore_register) :
echo JText::_(‘Register to read more…’);
elseif ($readmore = $this->item->params->get(‘readmore’)) :
echo $readmore ;
else :
echo JText::sprintf(‘Read more…’);
endif;
?>
</a>
<?php endif; ?>
</div>

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Advertisements
%d bloggers like this: