1

Is there any way that allows displaying tagged items like a category display? In other words, In the category listing for its belonged articles, we can see title and other meta data such as publish date and author, but listing items in a tag, the most reached display is displaying just the title, image and description, so I need a way that allows Tag to list items as displayed in a category showing article,Written by, Category, Published and Hits.

2

You can display more by overriding /components/com_tags/views/tag/tmpl/default_items.php. If you make:

<pre><?php print_r($item); ?></pre>

after this line:

<?php foreach ($items as $i => $item) : ?>

you will see that the item contains various additional information which you can output:

stdClass Object
(
    [type_alias] => com_content.article
    [content_item_id] => 24
    [core_content_id] => 1
    [match_count] => 1
    [tag_date] => 2015-01-29 14:28:39
    [core_title] => Joomla! Testing
    [core_alias] => joomla
    [core_body] => Thanks for helping us to test Joomla!
    [core_state] => 1
    [core_access] => 1
    [core_metadata] => {"robots":"","author":"","rights":"","xreference":""}
    [core_created_user_id] => 913
    [core_created_by_alias] => 
    [core_created_time] => 2011-01-01 00:00:01
    [core_images] => {"image_intro":"","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}
    [core_modified_time] => 2015-01-29 12:28:39
    [core_language] => *
    [core_catid] => 19
    [core_publish_up] => 2011-01-01 00:00:01
    [core_publish_down] => 0000-00-00 00:00:00
    [content_type_title] => Article
    [router] => ContentHelperRoute::getArticleRoute
    [author] => Super User
    [author_email] => test@test
    [link] => index.php?option=com_content&view=article&id=24:joomla
    [displayDate] => 2011-01-01 00:00:01
    [event] => stdClass Object
        (
            [afterDisplayTitle] => 
            [beforeDisplayContent] => 
            [afterDisplayContent] => 
        )

    [text] => Thanks for helping us to test Joomla!
    [core_params] => 
)

Unfortunately this is all you can output. Otherwise you should hack the core file to get more.

  • Hi, how exactly can I show i.e. author, date e.t.c. - Regards – geoplous Jan 17 '18 at 11:06
  • ok I found it it is: <?php echo $item->author; ?> – geoplous Sep 29 '18 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.