8

I want to create a menu item for a tag that shows the articles as in category blog layout. I have tried with these menu item types: "Compact List of Tagged Items", "List of all tags" and "Tagged Items" but with no luck.

According to the official documentation of content tags, it seems to be possible.

Once you have tags and some tagged items you can display them in the front end in several ways.

By default Joomla! will display tags embedded in each item that has been tagged. You can turn this display off by changing the parameters. You can control positioning of this display with layout overrides and alternate layouts and you can style it with your css.

You can create a menu link that displays a list of tags, with links to the tagged items for each tag.

> You can create a menu link that displays a list of tagged items for a given tag and display either as a list or blog style.

You can use one of the tags modules. Popular tags will display a linked list of the tags that have the most tagged items. Similar Tags will display a list of items that have a similar set of tags to the currently displayed item (note that this module does not display on pages that are not showing content items).

7

Since this problem seems has been already asked several times and there is still no good answer for that, I'd like to try to provide my solution from the template override side. The steps are quite complex but it should be easy.

Note : I'm using Joomla 3.4.4 and template protostar while creating this tutorial

First, copy this files :

[root]/components/com_tags/views/tag/tmpl/default.php
[root]/components/com_tags/views/tag/tmpl/default.xml
[root]/components/com_tags/views/tag/tmpl/default_items.php

to

[root]/templates/your_template_name/html/com_tags/tag/default.php
[root]/templates/your_template_name/html/com_tags/tag/default.xml
[root]/templates/your_template_name/html/com_tags/tag/default_items.php

replace the file names to something you like, for example 'taggedblog', so it will become :

[root]/templates/your_template_name/html/com_tags/tag/taggedblog.php
[root]/templates/your_template_name/html/com_tags/tag/taggedblog.xml
[root]/templates/your_template_name/html/com_tags/tag/taggedblog_items.php

Open the file [root]/templates/your_template_name/html/com_tags/tag/taggedblog.xml at the top of file you will see this code :

<layout title="com_tags_tag_view_default_title" option="com_tags_tag_view_default_option">

change that to

<layout title="Tagged Blog" option="taggedblog">

At this point, you should see a new menu item type called Tagged Blog when creating a new menu item from your menu manager. See this image below

New Tagged Blog Menu Item

Now, Open file [root]/templates/your_template_name/html/com_tags/tag/taggedblog_items.php

at lines 62 delete this code :

<ul class="category list-striped">

and it's </ul> closing tag at lines 90

then, still on the same file, delete these codes started at lines 64:

<?php if ($item->core_state == 0) : ?>
                <li class="system-unpublished cat-list-row<?php echo $i % 2; ?>">
            <?php else: ?>
                <li class="cat-list-row<?php echo $i % 2; ?> clearfix" >

<?php endif; ?> at lines 70, and closing tag </li> at lines 85

Next, add <div class="span5"> at 64 lines after the code <?php foreach ($items as $i => $item) : ?> and add closing </div> before the <?php endforeach; ?>

Next, arround lines 77 before the code <?php if ($this->params->get('tag_list_show_item_description', 1)) : ?> add this code :

<?php
    $db = JFactory::getDBO();
    $query = $db->getQuery(true);
    $query->select('introtext')->from('#__content')->where('id=' . (int)$item->content_item_id);
    $db->setQuery($query);
    //displaying the intro image
    $images  = json_decode($item->core_images);
    if(!empty($images->image_intro)) {
        echo '<img src="'.$images->image_intro.'">';
    }
    //displaying the intro text
    $introtext = $db->loadResult();
    echo $introtext;

    ?>

At this point, introtext and intro image should have been displayed on the the website.

Now, open the file [root]/templates/your_template_name/html/com_tags/tag/taggedblog.php , around lines 51 you will see this code <?php echo $this->loadTemplate('items'); ?> , change that line to :

<div class="row"><?php echo $this->loadTemplate('items'); ?></div>

That's all.

Now try to create a menu item with Tagged Blog type from your joomla menu manager, and see the result.

To make things easier, I have uploaded those files above in here. Have fun!

  • 2
    I can't believe this feature has not yet been implemented. – Alfredo Osorio Sep 25 '15 at 16:35
2

This is not currently possible. The closest you can get is Tagged Items. There is an article in the Joomla Forums about how to add the read more. http://forum.joomla.org/viewtopic.php?f=708&t=838191

This is also currently a request on ideas.joomla.org at http://ideas.joomla.org/forums/84261-joomla-idea-pool/category/12057-content?query=category%20blog%20tagged%20items. You can go and vote for it to be included.

protected by Community Nov 30 '15 at 17:40

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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