3

I'm using the latest version of Drupal (7.8). I am using Views to list out all articles with a certain tag in a block. I'm showing the latest 5 articles. No problems so far.

Now I want to customize the display so that the latest article displays with the title as well as the featured image whereas the other 4 articles show up with the title only.

I'm trying to use the suggested templates feature but am not sure how to use it since the HTML comes pre-created in the $rows variable.

Sort of like this:

Block with 1st article having an image and title and other with title only

3 Answers 3

2

Look into creating your first article display as an attachment. Attachments allow you to group different views together. This is for Drupal 6 and Views 2, but it should give you some idea of what attachments are.

A Views Attachment is simply a type of Views Display that gets attached to another View Display (usually a page display or a block display).

0
0

You should theme your Views and hide it programmatically.

1
  • 1
    Thanks Nikit, but I'm a complete Drupal newbie, so could you elaborate a little further? Commented Sep 30, 2011 at 11:14
0

A convenient way to customize the views markup for individual views rows, is to use the Display Suite module.

Where you would choose to display "fields" or the "rendered entity" on your views configuration, you can select "Display Suite". In the configuration for this setting, you can define different view modes to use for row1, row2, row3 etc. However, this only works if you limit the output of the view to n results (with or without paging).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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