When you click on a tag inside an article you go to com-tags view-tag, that is created by com_tags/views/tag/tmpl/default_items. This is a blog with articles with the same tag. I want there, inside every article to display also the tags. I have created an override for this view: ../html/com_tags/tag/tag_items.php and added there this code (took it from /components/com_content/views/article/tmpl/default.php)
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
According to Joomla "Sharing layouts across views or extensions with JLayout" documentation I should have my tags there, but obviously I have somewhere an issue as I am receiving an error on the front end.
Call to a member function render() on null
The code is (I can not manage to show it well, but it is the original Joomla /components/com_tags/views/tag/tmpl/default_items.php):
authorise('core.edit', 'com_tags');
$canCreate = $user->authorise('core.create', 'com_tags');
$canEditState = $user->authorise('core.edit.state', 'com_tags');
JFactory::getDocument()->addScriptDeclaration("
var resetFilter = function() {
document.getElementById('filter-search').value = '';
}
");
?>
toString()); ?>" method="post" name="adminForm" id="adminForm" class="form-inline">
params->get('show_headings') || $this->params->get('filter_field') || $this->params->get('show_pagination_limit')) : ?>
params->get('filter_field')) : ?>
escape($this->state->get('list.filter')); ?>" class="inputbox" onchange="document.adminForm.submit();" title="" placeholder="" />
" onclick="document.adminForm.submit();" class="btn">
" class="btn" onclick="resetFilter(); document.adminForm.submit();">
params->get('show_pagination_limit')) : ?>
pagination->getLimitBox(); ?>
items)) : ?>
items as $i => $item) : ?>
core_state == 0) : ?>
">
clearfix">
type_alias === 'com_users.category') || ($item->type_alias === 'com_banners.category')) : ?>
escape($item->core_title); ?>
link); ?>">
escape($item->core_title); ?>
event->afterDisplayTitle; ?>
core_images); ?>
params->get('tag_list_show_item_image', 1) == 1 && !empty($images->image_intro)) : ?>
link); ?>">
image_intro); ?>" alt="image_intro_alt); ?>">
params->get('tag_list_show_item_description', 1)) : ?>
event->beforeDisplayContent; ?>
core_body, $this->params->get('tag_list_item_maximum_characters')); ?>
event->afterDisplayContent; ?>