- Posts: 98
COMMUNITY FORUM
How to get tag name in tag itemlist?
- Roman Lipatov
- Topic Author
- Offline
- Premium Member
Less
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.
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
- Offline
- Elite Member
Less
More
- Posts: 169
8 years 5 months ago #153539
by JoomlaWorks Support Team
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
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.
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
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 98
8 years 5 months ago #153542
by Roman Lipatov
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.
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
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 5 months ago #153553
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
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.
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
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 98
8 years 5 months ago #153555
by Roman Lipatov
Replied by Roman Lipatov on topic How to get tag name in tag itemlist?
Please Log in or Create an account to join the conversation.
- JoomlaWorks Support Team
- Offline
- Elite Member
Less
More
- Posts: 169
8 years 5 months ago - 8 years 5 months ago #153572
by JoomlaWorks Support Team
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
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
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 98
8 years 5 months ago #153577
by Roman Lipatov
Replied by Roman Lipatov on topic How to get tag name in tag itemlist?
Please Log in or Create an account to join the conversation.
- JoomlaWorks Support Team
- Offline
- Elite Member
Less
More
- Posts: 169
8 years 5 months ago #153629
by JoomlaWorks Support Team
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
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
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 98
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
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 5 months ago #153670
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
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.