当前位置: 动力学知识库 > 问答 > 编程问答 >

php - Remove readmore article title from joomla

问题描述:

How can I remove the article title from the readmore link in Joomla?

I don't have sh404SEF.

<?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', $this->escape($this->item->title));

endif; ?>

Change this rule:

echo JText::sprintf('Read more', $this->escape($this->item->title));

To:

echo 'Read More';

Is also not corrent because it's not multilangual.

Anyone knows the solution?

网友答案:

You can configure it within your post-options. There you can specify if you want to show the button at all, and if so, if the title should be displayed on it.

You can configure that in the post itself or in the global options for a whole category or all posts. Unfortunately I don't know the english terms for this two options, since I use the german translation.

=== EDIT ===

Okay, I just rechecked it. You add a new menu-item and select for example "Category Blog" as Menu Item Type. Then on the right side you open the "Article Options"-Panel. There you'll find the two options 'Show "Read More"' and 'Show Title with Read More'. Choose "Hide" with the latter one. This way your button/link will only contain the text "Read More" (or which language you have selected) and not the title ;)

If you want to generally set this up. There is another way to make this behaviour default. Go to your Content-Administration and select "Options" in the toolbar. Select the tab "Articles" (it's the first). There you'll see the two options I already mentioned.

网友答案:

I got it!

change

echo JText::sprintf('Read more', $this->escape($this->item->title));  

to

echo JText::_('READ MORE');  

And you can change the text in language/nl-NL.com_content.ini and the other languages too
just search for read more

分享给朋友:
您可能感兴趣的文章:
随机阅读: