YOOtheme Pro is here! The best WordPress and Joomla theme. Learn more

Avatar barcelona.co asked

Use Joomla Tags

Hi !

I see that Zoo has its own tags system, but I would like to use Joomla's tags, as I have to display items from many sources (articles, zoo items, own component) filtered by tags.

I didn't see anything like this, I though about a custom field type for that, am I right?

Any other clues?
I'm a web developer so, even tricky tips may be useful!

Thank you!

  • Joomla
  • ZOO


3 Answers


Avatar barcelona.co answered

if (yootheme.support == null) {  

If anyone needs this in the future, this is how I dit it.

1/ Create the folder media/zoo/elements/joomlatag

2/ Create 2 files in this folder

<?xml version="1.0" encoding="utf-8"?>
<element type="joomlatag" group="Other">
<name>Joomla Tag</name>
<creationDate>Janvier 2018</creationDate>
<description>Tags Joomla</description>


class ElementJoomlaTag extends Element implements iSubmittable {  

    public function hasValue($params = array()) {  
        $value = $this->get('value');  
        return !empty($value);  

    public function edit() {  

        // Load tags list  
        $db = JFactory::getDBO();  
        $query  = $db->getQuery(true)  
            ->select('DISTINCT a.id AS value, a.path, a.title AS text, a.level, a.published, a.lft')  
            ->from('#__tags AS a')  
            ->where('a.published = 1 AND a.id != 1')  
            ->order('a.lft ASC');  
        $options = $db->loadObjectList();  

        // Adapt paths  
        $options = JHelperTags::convertPathsToNames($options);  

        // Import frameworks & create field  
        $document = JFactory::getDocument();  
        $document->addStyleDeclaration('.creation-form .element-joomlatag, .creation-form .element-joomlatag > div { overflow:visible }');  
        JHtml::_('formbehavior.chosen', '.zooJoomlaTags', null, array('placeholder_text_multiple' => JText::_('JOPTION_SELECT_TAG')));  

        // Return field  
        return JHtml::_('select.genericlist', $options, $this->getControlName('value').'[]', 'multiple class="zooJoomlaTags"', 'value', 'text', $this->get('value'));  


    public function renderSubmission($params = array()) {  
        return $this->edit();  

    public function validateSubmission($value, $params) {  
        return array('value' => $value->get('value'));  


3/ You can now add a field of type "Joomla tag"

Hope it can help someone ;)


Know someone who can answer? Share a link to this question via email or twitter.