Keyword

Make graphics display based on tags

More
11 years 6 months ago #111154 by Brian
I've got my articles set up with different tags and I need to display the "on" or "off" graphic on the header of each article based on whether the article has that tag associated with it or not.
Any tips on how I might set up the php for that or what variable I would check on that?
Thanks!

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

More
11 years 6 months ago #111155 by Brian
Replied by Brian on topic Re: Make graphics display based on tags
Anyone know where I could find the tags from the article page so I could display the right graphics?
Thanks!

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
11 years 6 months ago #111156 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Make graphics display based on tags
Can you explain your request with more details? perhaps I can help you

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

More
11 years 6 months ago #111157 by Brian
Replied by Brian on topic Re: Make graphics display based on tags
You bet. I've got my k2 items separated into 3 categories to determine how they display on the home page (banner, thumbnail, general). I've also got tags set on my articles based on the type of article they are (News, Event, Action, etc.). On the article page, I have a graphic to indicate the type of article and I need to know how to display the correct graphic based on the type of article.

Let me know if that is clearer. If not, I can put some screenshots up that should help.

thanks!

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
11 years 6 months ago #111158 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Make graphics display based on tags
Its clearer now, but screenshots will make it more clearer.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

More
11 years 6 months ago - 11 years 6 months ago #111159 by Brian
Replied by Brian on topic Re: Make graphics display based on tags
You bet. :)

So, here's the homepage:

..and I'm using the Categories to display the banners, thumbnails and general articles in their particular areas.

Here's the article page:

So, I need to use the tags that I've got set up (News Article, Event, Action, etc.) to display the graphic at the upper left. I'm also using tags for the "Category Title" graphics, so, some articles will be Corporate, Global, Diversity, etc. and articles may fit into several of those "tags" (and several of the Category Title indicators will be in color) so, I need to know how I can display specific graphics based on the tags for the articles.

Ideally, I would like the user to be able to click the "Category Title" buttons to display all of the articles using that particular tag, but that's the next battle. :)

Thanks!!

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
11 years 6 months ago #111160 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Make graphics display based on tags
Hi Brian,

I don't think you can do this without a custom module.

I can have a look at details and then send you an offer to develop the custom module.

Please let me know if you are willing to go with this approach.

Thanks

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

More
11 years 4 months ago - 11 years 4 months ago #111161 by Brian
Replied by Brian on topic Re: Make graphics display based on tags
Got it. Was actually pretty easy. For anyone else out there that might run into this and want to do it, here's the trick:

Just create a variable and a foreach loop that checks all the tags and, if one matches, switch the variable. When the foreach is done, check the variable and display the right version of that graphic. Was a little tricky for me only because each item could have multiple tags and each graphic had an "on" and "off" version, but, once I figured out the syntax I needed (to reference the tag) the code was pretty simple.

Here's the code:
Log in  or Create an account to join the conversation.