Лучший Ответ Kess , 28 January 2014 - 00:25
Hello,
There are no elements for this but you can make it using special positions.
For example, we need to add keywords and description, then add this to the full.php of your item type, right next after this line:
defined('_JEXEC') or die('Restricted access');
add
$document = JFactory::getDocument(); $document->setMetadata('description', strip_tags(trim($this->renderPosition('meta-description')))); $document->setMetadata('keywords', strip_tags(trim($this->renderPosition('meta-keywords'))));
This will use standard Joomla function to set metadata. And we output the data from our new positions there.
We also need to add these new positions to the full layout in positions.xml:
<position name="meta-description">Meta description</position> <position name="meta-keywords">Meta keywords</position>
Now you can go to the configuration of your full layout and add some existing fields to these positions if you want them to be filled automatically with existing elements. Or if you need to add more keywords, you can make a new text element for this and put it in the submission as well.
If you want keywords to be separated by comma when using existing elements, you can change it's style like this:
$document->setMetadata('keywords', strip_tags(trim($this->renderPosition('meta-keywords', array('style' => 'comma')))));
For the price it's better to use its simplest template.
Перейти к сообщению