1

I am new to Drupal and am working on my first project.

I have a Views frontpage with a grid layout of teaser displays of recent posts of a single content type. I would like the background of the teasers to be determined by their taxonomy tags. For example, all teasers for content 'A' tagged with 'x' will have a blue border while all teasers for content 'A' tagged with 'y' will have a red border.

Creating multiple content types seems very inefficient as everything else would be the same and only the borders would differentiate them.

I am using the following modules: Views, Display Suite, Context, and Context PHP to accomplish this. Unfortunately, I have no PHP skills and trying to learn PHP in tandem with identifying Drupal and Module variables and classes is not proving an efficient approach.

I was thinking that approaching this with Context 'conditions' for each taxonomy tag for either a 'div' class or for all html 'article' tags (by way of Display Suite I can choose to use an HTML 'article' tag as the layout wrapper for all teaser displays) and a 'theme HTML' reaction will accomplish what I want. The 'theme HTML' reaction will have to be invoked for each teaser display (one page load multiple 'theme HTML' reactions). How can I set a Context condition that selects either a 'div' class or 'article' tag?

Is this even possible? Is there a better way? Any help would be greatly appreciated. Thank you.

I am using D7.

  • are u using d7...? – monymirza Dec 13 '12 at 5:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.