More than 1000+ satisfied clients and counting, since 2010

Blog

Add Joomla Article Title in Read More Link Dynamically

Add Joomla Article Title in Read More Link DynamicallyIn Joomla content management system, you can set a dynamic page for your website’s blog. It gets updated each time you publish a blog post. You can display excerpts of a number of blog posts in one page with a Read More link. You must be acquainted with editing the text of Read More links and styling the Read More buttons. But this blog post introduces how you can add Joomla article title in Read More links.

Add Joomla Article Title in Read More Link – Setup

  • Go to Joomla installation folder in your local system
  • Open the ‘template’ folder
  • Create Folders
  1. Create a new folder and name it ‘html’
  2. Inside html folder create ‘com_content’ folder
  3. In that folder create 3 different folders – ‘category’, ‘frontpage’ and ‘section’
  • Locate files
  1. (joomla)/components/com_content/views/category/tmpl/blog_item.php
  2. (joomla)/components/com_content/views/frontpage/tmpl/default_item.php
  3. (joomla)/components/com_content/views/section/tmpl/blog_item.php
  • Copy Files
  1. (yourtemplate)/html/com_content/category/blog_item.php
  2. (yourtemplate)/html/com_content/frontpage/default_item.php
  3. (yourtemplate)/html/com_content/section/blog_item.php

Add Joomla Article Title in Read More Link – Steps

Now after setting up, we need to add Joomla article title in Read More link of our blog. You can do this by the help of the following steps:

  • Open each of the above files that you copied
  • Browse to the bottom of these files
  • Look for the following code:

<a href="<?php echo $this->item->readmore_link; ?>" class="readon<?php echo $this->item->params->get('pageclass_sfx'); ?>">
<?php 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>

  • Find the code – echo JText::sprintf(‘Read more…’);
  • Replace it with – echo JText::sprintf(‘Read more’, $this->item->title);
  • Test it

Follow these easy steps to add Joomla article title in Read More links. If you are unable to include the titles inside the Read More buttons, then request a quote. Our team will assist you to add Joomla article title in Read More links.

Written by

The author didnt add any Information to his profile yet