Keyword

which file to edit to show the tag I clicked ?

  • Robert Watson
  • Robert Watson's Avatar Topic Author
  • Offline
  • New Member
More
3 weeks 1 day ago - 3 weeks 1 day ago #172694 by Robert Watson
Robert Watson created the topic: which file to edit to show the tag I clicked ?
I have a K2 Tools module which lists all the K2 tags in a tag cloud .
When i click a K2 tag - all K2 items with matching tags are displayed in a list in the main body of the site.

i want to ADD THE NAME OF THE SELECTED K2 TAG to the top of the item list to show what's been selected.

I am new to sub-templating - I just need to know WHICH K2 FILE to edit to do this.

Help !!

k2 version 2.9.0
Last edit: 3 weeks 1 day ago by Robert Watson. Reason: clarity

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
3 weeks 20 hours ago #172701 by Fotis
Fotis replied the topic: which file to edit to show the tag I clicked ?
It's the file tag.php.

Learn how to copy K2 source template overrides into your Joomla template by reading this: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • Robert Watson
  • Robert Watson's Avatar Topic Author
  • Offline
  • New Member
More
3 weeks 16 hours ago #172713 by Robert Watson
Robert Watson replied the topic: which file to edit to show the tag I clicked ?
I’ve tried to override several tag.php files.

Can you be a bit more specific about the path to the tag.php file you mention.

I copied the ‘default’ file directory to my templates directory to override it.
Is it the ‘default’ folder that you mean?
I’ve done a test edit - by adding a <p> html tag and put some text in it - but nothing shows up.

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
3 weeks 15 hours ago #172716 by Fotis
Fotis replied the topic: which file to edit to show the tag I clicked ?
Source: /components/com_k2/templates/default/tag.php
Target: /templates/YOURTEMPLATE/html/com_k2/default/tag.php

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
3 weeks 15 hours ago #172717 by Fotis
Fotis replied the topic: which file to edit to show the tag I clicked ?
If caching in Joomla is enabled, you may need to clear it first to view any changes you do in your site.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • Robert Watson
  • Robert Watson's Avatar Topic Author
  • Offline
  • New Member
More
2 weeks 6 days ago #172725 by Robert Watson
Robert Watson replied the topic: which file to edit to show the tag I clicked ?
Thanks Fotis
Can you also give me the code snippet that will extract the tag name that was selected?

Please Log in or Create an account to join the conversation.

  • Robert Watson
  • Robert Watson's Avatar Topic Author
  • Offline
  • New Member
More
2 weeks 6 days ago #172726 by Robert Watson
Robert Watson replied the topic: which file to edit to show the tag I clicked ?
Can I ask for this to be made an option on the tag view?
E.g. show selected tag name ?

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
2 weeks 6 days ago #172733 by Fotis
Fotis replied the topic: which file to edit to show the tag I clicked ?
This should actually be default but I somehow missed it all these years. To be added in K2 v2.10.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • Robert Watson
  • Robert Watson's Avatar Topic Author
  • Offline
  • New Member
More
2 weeks 6 days ago #172746 by Robert Watson
Robert Watson replied the topic: which file to edit to show the tag I clicked ?
Great!!
Thanks for your help.
I managed to do it using the template override in tag.php to parse the page title from the URL.
I used PHP explode function to cut it at the colon “:” in the page title string.

Thanks Fotis

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
2 weeks 5 days ago #172756 by Fotis
Fotis replied the topic: which file to edit to show the tag I clicked ?
You're welcome Robert :)

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

Moderators: william white

Powered by Kunena Forum