How get Tags in Joomla

For Joomla! 3.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Post Reply
kbmaster
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Apr 03, 2019 7:50 pm

How get Tags in Joomla

Post by kbmaster » Wed Apr 03, 2019 7:58 pm

Hi,

I have problem with module, I need to show on the page some articles, but I need to insert icons on the thumbnails, like 'video' or 'photo', to do this I thought I can take tag from joomla article, like video and make simple 'if loop', like "if tag is like video, insert icon of video". For now I make it in another module, where I check the category and insert properly icon, but I need to make 10 more modules like this on front page, and I need somethink whitch will work better and more universally. In attachment I add a simple, what I need to make. I see there is option to choose articles by they tag, so i need only that part of code to compare tags.

My code:
<?php
foreach($list as $item){
foreach($item->tags->itemTags as $tag){
if (($tag->title)=="video"){
?> <i class="fa fa-play-circle"></i>
<?php }
elseif (($tag->title)=="galeria"){
?> <i class="fa fa-camera"></i> <?php
}
else{echo $tag->title; echo ",";}
}
}
?>

Thanks for any answers.
You do not have the required permissions to view the files attached to this post.
Last edited by toivo on Thu Apr 04, 2019 6:32 am, edited 1 time in total.
Reason: mod note: moved to 3.x Coding

CDXXonline
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 178
Joined: Fri Oct 13, 2017 8:00 pm

Re: How get Tags in Joomla

Post by CDXXonline » Mon Apr 08, 2019 10:27 am

Maybe go by id.

if ($tag[id] == 1) {......}

I'm unsure how you have things organized.


Post Reply

Return to “Joomla! 3.x Coding”