Keyword

How to get tag name in tag itemlist?

  • Roman Lipatov
  • Roman Lipatov's Avatar Topic Author
  • Offline
  • Premium Member
More
8 years 5 months ago #153527 by Roman Lipatov
How to get tag name in tag itemlist? was created by Roman Lipatov
Hi!

I need to modificate meta titles and descriptions on tags pages.
http://mysites/news/tags/tag1

But I want to make it only using templates overrides.

How I can get tag name (variable) in template file /components/com_k2/templates/default/tag.php

Thanks.

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

  • JoomlaWorks Support Team
  • JoomlaWorks Support Team's Avatar
  • Offline
  • Elite Member
More
8 years 5 months ago #153539 by JoomlaWorks Support Team
Replied by JoomlaWorks Support Team on topic How to get tag name in tag itemlist?
Hi,
You can create a K2 tag menu item and add the Meta Description and Keywords at the menu metadata options.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Roman Lipatov
  • Roman Lipatov's Avatar Topic Author
  • Offline
  • Premium Member
More
8 years 5 months ago #153542 by Roman Lipatov
Replied by Roman Lipatov on topic How to get tag name in tag itemlist?

Teo wrote: Hi,
You can create a K2 tag menu item and add the Meta Description and Keywords at the menu metadata options.


Yes, but I still need get tag name (variable) in template, because I need to add descritption for this tag page.



My idea is to make tags pages same as categories pages.
Users should not see the difference between these pages.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 5 months ago #153553 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to get tag name in tag itemlist?
The URL pattern you see here, was created from a menu item.
Create a blank K2 categories menu item (leave the category selection empty) and call it eg: show or content, this will create the URL pattern you see there.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Roman Lipatov
  • Roman Lipatov's Avatar Topic Author
  • Offline
  • Premium Member
More
8 years 5 months ago #153555 by Roman Lipatov
Replied by Roman Lipatov on topic How to get tag name in tag itemlist?
You understood me wrong.

I need to get Tag name in tags template /components/com_k2/templates/default/tag.php

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

  • JoomlaWorks Support Team
  • JoomlaWorks Support Team's Avatar
  • Offline
  • Elite Member
More
8 years 5 months ago - 8 years 5 months ago #153572 by JoomlaWorks Support Team
Replied by JoomlaWorks Support Team on topic How to get tag name in tag itemlist?
You can fetch the tag name with php. Try this code snippet at your tag.php template
$tag = JRequest::getString('tag');
echo $tag;

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Last edit: 8 years 5 months ago by JoomlaWorks Support Team.

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

  • Roman Lipatov
  • Roman Lipatov's Avatar Topic Author
  • Offline
  • Premium Member
More
8 years 5 months ago #153577 by Roman Lipatov
Replied by Roman Lipatov on topic How to get tag name in tag itemlist?
Thanks Teo!
It works perfect.

Tell me please, how I can get other data from tags table, for example tag id?

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

  • JoomlaWorks Support Team
  • JoomlaWorks Support Team's Avatar
  • Offline
  • Elite Member
More
8 years 5 months ago #153629 by JoomlaWorks Support Team
Replied by JoomlaWorks Support Team on topic How to get tag name in tag itemlist?
You must again use PHP and query the database table macb_k2_tags in order to get the data you want.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Roman Lipatov
  • Roman Lipatov's Avatar Topic Author
  • Offline
  • Premium Member
More
8 years 5 months ago - 8 years 5 months ago #153650 by Roman Lipatov
Replied by Roman Lipatov on topic How to get tag name in tag itemlist?
Yes, I tried, but it does not work...
$id = JRequest::getString('id');
echo $id;
Last edit: 8 years 5 months ago by Roman Lipatov.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 5 months ago #153670 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to get tag name in tag itemlist?
This will not work, you need an SQL query in order to retrieve further data.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum