[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1137
  • Last Modified:

Personalize "read more..." doesn't work on Joomla articles

Dear Expert:

I'm creating a Joomla site. Some of the articles contain a quiz, so I want to show solution when user press the "Read more..." link. This is working fine.

At back-end, when editing the article, I found a option to personalize the "Read more..." text ("Alternative Read more" property, under "Advanced parameters". But when changing this text, nothing changes: the original "Read more..." text appears at the front end.

What I'm doing wrong ?
0
gplana
Asked:
gplana
  • 3
  • 3
1 Solution
 
enriquecadalsoCommented:
It seems some templates have this hard coded. The JA_Purity that comes with joomla package does not change the read more text.

What template are you using?
0
 
gplanaAuthor Commented:
I'm using JA_Purity.
I have some PHP experience. Could I change this behaviour in order it takes the custom text instead of the standard text ?
0
 
manomaniCommented:
Hi.,

To change the readmore text in ja_purity

For front page Display change:

File
----
root/templates/ja_purity/html/com_content/frontpage/default_item.php

Line no:130 (around if you change anything) for non-registered.
<?php echo JText::_('Register to read more...'); ?>

Line no:132 for registered.
<?php echo JText::_('Read more...'); ?>


Change these text inside the single quotes to your choice.


0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
gplanaAuthor Commented:
Sorry, but I don't think it will work. The text that really appears now t's not "read more..." but the catalan translation of "read more..." (because I have configured with this languae). Also, it seems you are trying to change the text for all the articles, and I want just to change it for one specific article.
0
 
manomaniCommented:
Hi.,

To change the readmore text in ja_purity

For front page Display change:

File
----
root/templates/ja_purity/html/com_content/frontpage/default_item.php

Check For the code around line no : 120 - 130 and replace to this.......
<?php if ($this->item->params->get('show_readmore') && $this->item->readmore) : ?>
	<a href="<?php echo $this->item->readmore_link; ?>" title="<?php echo $this->escape($this->item->title); ?>" class="readon<?php echo $this->escape($this->item->params->get('pageclass_sfx')); ?>">
    
			<?php if ($this->item->readmore_register) : ?>
				<?php echo JText::_('Register to read more...'); 
                elseif ($readmore = $this->item->params->get('readmore')) :
				echo $readmore;
			 else : ?>
				<?php echo JText::_('Read more...'); ?>
			<?php endif; ?>
	</a>
<?php endif; ?>

Open in new window

0
 
manomaniCommented:
Hi.,

Note that a new elseif condition is added after the first if condition in the above code which is missing in original....

which makes the difference...............

Regards
manomani.
0
 
gplanaAuthor Commented:
Excellent. I solved the problem doing exactly what you said.
Thank you very much.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now