Tagged items with read more button?

Need help with the Administration of your Joomla! 3.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
random12
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 103
Joined: Wed Jan 16, 2013 9:02 pm

Tagged items with read more button?

Post by random12 » Sun Mar 09, 2014 7:52 pm

When clicking on a tag, the articles containing the tag are displayed but not the read more button. Any setting for that?
Thanks

Joomla 3.2.3

User avatar
pinkshirt
Joomla! Explorer
Joomla! Explorer
Posts: 285
Joined: Wed Oct 01, 2008 5:16 am
Location: Sydney, Australia
Contact:

Re: Tagged items with read more button?

Post by pinkshirt » Mon Mar 10, 2014 4:21 am

There isn't a setting to add this in (as far as I know), but you could add a read more button by doing a template override. Copy the file /components/com_tags/views/tags/tmpl/default_items.php to /templates/[your-template-name]/html/com_tags/tags/default_items.php.

Then add something like the following code to /templates/[your-template-name]/html/com_tags/tags/default_items.php

Code: Select all

<p class="readmore"><a class="btn" href="<?php echo JRoute::_(TagsHelperRoute::getTagRoute($item->id . '-' . $item->alias)); ?>"><?php echo echo JText::_('COM_CONTENT_READ_MORE'); ?></a></p>
If you add this after line 110 (and before the closing </li>) then a read more button should appear below each tag.

pwidner
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Dec 27, 2008 12:57 am

Re: Tagged items with read more button?

Post by pwidner » Wed Mar 19, 2014 10:57 pm

Hello Pink shirt,

This didn't work for me. Have you tried it? I'd like to find a solution. I don't understand why there isn't a read more option?

User avatar
pinkshirt
Joomla! Explorer
Joomla! Explorer
Posts: 285
Joined: Wed Oct 01, 2008 5:16 am
Location: Sydney, Australia
Contact:

Re: Tagged items with read more button?

Post by pinkshirt » Thu Mar 20, 2014 7:28 am

Sorry, it should be copy
/components/com_tags/views/tag/tmpl/default_items.php to /templates/[your-template-name]/html/com_tags/tag/default_items.php.

Then in the new file add the following to around Line 86 (before the closing </li>)

Code: Select all

<p class="readmore"><a class="btn" href="<?php echo JRoute::_(TagsHelperRoute::getItemRoute($item->content_item_id, $item->core_alias, $item->core_catid, $item->core_language, $item->type_alias, $item->router)); ?>">Read more</a></p>

pwidner
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Dec 27, 2008 12:57 am

Re: Tagged items with read more button?

Post by pwidner » Thu Mar 20, 2014 3:36 pm

Thank you pinkshirt! Works perfectly!

bjornv
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Mon Sep 29, 2008 3:24 pm

Re: Tagged items with read more button?

Post by bjornv » Thu Apr 24, 2014 6:43 pm

Thanks to both of you, this worked well for me as well, to add a read more to the tagged items menu display. I look forward to more development with the new tags system in J3.

Bizarrely, this also solved a problem I had with the filter field refusing to hide! Despite my clearly setting everything in the backend to "hide filter," the field filter would appear. I am linking to my help request on it in case others running across the same thing:

http://forum.joomla.org/viewtopic.php?f=708&t=840588

random12
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 103
Joined: Wed Jan 16, 2013 9:02 pm

Re: Tagged items with read more button?

Post by random12 » Sun May 04, 2014 3:31 pm

Thanks, will give the override a try.
Another topic, but would be cool if there was an option to include archived articles for a tag

User avatar
LukeDouglas
Joomla! Explorer
Joomla! Explorer
Posts: 250
Joined: Sat Dec 08, 2007 8:23 pm

Re: Tagged items with read more button?

Post by LukeDouglas » Thu Jan 29, 2015 4:40 am

I have to say, the development team missed the boat on this one. The option to have a 'readmore' link should have been included with the 'tagged items' menu type. It sucks to have to customize the template to provide an override with a feature that has been a staple of Joomla for many years.

GizellaN
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sat Nov 30, 2013 2:53 pm

Re: Tagged items with read more button?

Post by GizellaN » Wed Apr 20, 2016 12:03 pm

Hello,

Is there a fix for Joomla! 3.5.1 Stable version? There is no com_tags folder in the templates/my template/html folder. I've tried creating one, but that broke the Tags pages.
Is this a problem with the template I am using?

Thanks,
Gizella

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Tagged items with read more button?

Post by sovainfo » Wed Apr 20, 2016 3:18 pm

There have been over 100 changes applied for J352, many of which are fixes.

Don't understand what you mean by `broke the Tags pages`.
Just created overrides using the template manager. Those were overrides for protostar.
Overrides is something standard in Joomla, not all templates support the standard Joomla way. Suggest to check the documentation of your template. What template are you using?
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

GizellaN
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sat Nov 30, 2013 2:53 pm

Re: Tagged items with read more button?

Post by GizellaN » Wed Apr 20, 2016 3:56 pm

By breaking the page I meant, that as soon as I added the com_tags folder in the template, instead of showing articles on any Tags page, it only had a question mark. After removing the folder it went back to normal. (See attached image of the same area of the page.)

I am using Rockettheme Maelstrom. I will ask in the Rockettheme forum what they would recommend for the fix.

Thanks sovainfo.
You do not have the required permissions to view the files attached to this post.

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Tagged items with read more button?

Post by sovainfo » Wed Apr 20, 2016 5:59 pm

Did you try with protostar? Use template manager to create the override and use [?|/]tmpl=protostar on the url.

Note you have two views you can make overrides for: tag,tags.
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

GizellaN
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sat Nov 30, 2013 2:53 pm

Re: Tagged items with read more button?

Post by GizellaN » Thu Apr 21, 2016 1:42 pm

One more question about this code. I was able to create the override, and it show the Read More button now. But it shows it under every article, not just the ones that need it. Is it possible to add something else to the code that will make the Read more link show up only for those items in which I had inserted Read more?

Thank you,
Gizella

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Tagged items with read more button?

Post by sovainfo » Fri Apr 22, 2016 1:45 am

The blog_item has this code:

Code: Select all

<?php if ($params->get('show_readmore') && $this->item->readmore) :
	if ($params->get('access-view')) :
		$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language));
	else :
		$menu = JFactory::getApplication()->getMenu();
		$active = $menu->getActive();
		$itemId = $active->id;
		$link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false));
		$link->setVar('return', base64_encode(JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language), false)));
	endif; ?>

	<?php echo JLayoutHelper::render('joomla.content.readmore', array('item' => $this->item, 'params' => $params, 'link' => $link)); ?>

<?php endif; ?>
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

scifivision
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 192
Joined: Mon Jun 01, 2009 5:24 am

Re: Tagged items with read more button?

Post by scifivision » Sat May 14, 2016 4:50 pm

I got the read more added (though in case anyone has the confusion I did, if you used the updated files that webchun talked about, the </li> tag is not there anyway, you have to put it right before this at the end:

Code: Select all

</div>
		<?php endforeach; ?>


	<?php endif; ?>
But I'm trying to make it look like my other menu items, what code do you add to also display author, published date, and category?

Thanks

ETA I apologize part of that I got mixed up which forum I was on. This was an override for using tags in blog layout, but I can't figure out how to add the other components

patrickbmccabe
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Sun Oct 08, 2017 4:32 pm

Re: Tagged items with read more button?

Post by patrickbmccabe » Fri Oct 13, 2017 8:40 am

This worked Very well for me...
However,
The "read more" is styled differently than my template
How would I get this php element to obey the css of my template?


Locked

Return to “Administration Joomla! 3.x”