简体   繁体   中英

Modify Joomla Tags Result Page

I want to show my article intro text and item image with link to the full article in the result page for Joomla Tags.

Is there a way to do this, or how can I modify the code to get the expected results?

I tried to add in components\\com_tags\\views\\tag\\tmpl\\default_items.php <?php echo $this->item->introtext; ?> <?php echo $this->item->introtext; ?> but it does not work there as in other cases. I do not know php well enough, so would like to know if there are other suggestions.

Thanks

Updated

Use <?php echo $item->core_body; ?> <?php echo $item->core_body; ?> because the tags results use the standardized field names.

However the standard view of tagged items (non compact) contains an option that allows you to display the text (it will be intro text for an article, description for a weblink, category or news feed, or street address for a contact). You need to select this when making a menu item for that tag. Or got to global settings and change Item description to show or make a layout that does not use the show/hide parameter or defaults to show.

This is the relevant code block:

    <?php if ($this->params->get('', 1)) : ?>
        <?php echo $item->event->beforeDisplayContent; ?>
        <span class="tag-body">
            <?php echo JHtml::_('string.truncate', $item->core_body, $this->params->get('tag_list_item_maximum_characters')); ?>tag_list_show_item_description
        </span>
        <?php echo $item->event->afterDisplayContent; ?>
    <?php endif; ?>

Notice that tag_list_show_item_description can be turned on or off.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM