0

my homepage is done with panels. Home panel contains a view that displays specifically 9 nodes that contain image field. Sort criteria is Random. These 9 nodes are in three rows each containing three. What I want to achieve is that image field of the first node in the first row would have image style: medium, second node in the row would have style: large, third would have medium again. Second row first node would have image style: large and so on.

I know there is a module to style specific nodes but this styling should be based not on the node itself but on the position it was given by the Random sort. Please see image attached.

I think it would be acceptable to shrink the images using CSS, but then each position should have it's own class, how could I go about this? Without JS li order targeting would be preferable.

Thanks a lot for your help.

enter image description here

0

You can add a field of the type "Global: View result counter"

This will add a number depending on the position of the result.

You can use this to add a class using token to the image.

  • Thanks for this. I cant seem to find a needed token to reference the count number to the image field class in the token list. What format should it be? – Ray Jan 31 '13 at 9:47
  • to use a token in a field you need to have the counter view above the image field other wise it will not be available in the image field – Mohammed Shameem Jan 31 '13 at 10:24

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.