J1.5:Add article title to read more link
From Joomla! Documentation
(Difference between revisions)
m |
m (clean up categories with <noinclude> tags) |
||
| (One intermediate revision by one user not shown) | |||
| Line 21: | Line 21: | ||
Open these files.<br /> | Open these files.<br /> | ||
| − | Nearly at the | + | Nearly at the bottom of these files you should be seeing something like: |
<source lang='php'> | <source lang='php'> | ||
<a href="<?php echo $this->item->readmore_link; ?>" class="readon<?php echo $this->item->params->get('pageclass_sfx'); ?>"> | <a href="<?php echo $this->item->readmore_link; ?>" class="readon<?php echo $this->item->params->get('pageclass_sfx'); ?>"> | ||
| Line 42: | Line 42: | ||
| − | [[Category:Tips and tricks]] | + | <noinclude>[[Category:Tips and tricks]]</noinclude> |
| − | [[Category:Tips and tricks 1.5]] | + | <noinclude>[[Category:Tips and tricks 1.5]]</noinclude> |
| − | [[Category:Article Management]] | + | <noinclude>[[Category:Article Management]]</noinclude> |
| − | [[Category:FAQ]] | + | <noinclude>[[Category:FAQ]]</noinclude> |
| − | [[Category:Tutorials]] | + | <noinclude>[[Category:Tutorials]]</noinclude> |
Revision as of 11:48, 1 September 2012
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
How to add an article title to the “Read more...” link?
For this you can use the overrides...
If they are not already there, in your template folder: create a new folder called 'html'.
In that folder you create a folder called 'com_content'.
And in that folder you create the folders called "category", "frontpage", "section"
Then locate the following files
- (joomla)/components/com_content/views/category/tmpl/blog_item.php
- (joomla)/components/com_content/views/frontpage/tmpl/default_item.php
- (joomla)/components/com_content/views/section/tmpl/blog_item.php
Copy the files to your template's html folders
- (yourtemplate)/html/com_content/category/blog_item.php
- (yourtemplate)/html/com_content/frontpage/default_item.php
- (yourtemplate)/html/com_content/section/blog_item.php
Open these files.
Nearly at the bottom of these files you should be seeing something like:
<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>
Change the line
echo JText::sprintf('Read more...');
into
echo JText::sprintf('Read more', $this->item->title);
The “Read more” link should now look like this: Read more: (Article title)
