How to Show the 1st New(node) with Image

Events happening in the community are now at Drupal community events on www.drupal.org.
jolly guy's picture

Hello,
Is there a way to configure a Views block to showing the first node with its photo in a list and show the other without photos only titles and links?

for example, I have a block set up to show all the stories in a given Taxonomy. But I want to show the first story with photo from that list.

Comments

Yep, you can do that

jimsmith's picture

Create two versions of the same view, keeping most of the same default settings. One will be as a block. The other will be married to the first if you make it a views attachment.

Starting with the first node view with the image, make a block and change your default here to add the image. Set "Items to display" to 1.

The other view, then, will be the attachment. Set "Items to display" here to how many additional items you want (or 0 if you plan to use a pager and don't want to limit the number of nodes). Also under "Items to display" you'll want to set the offset to 1. That's the key to making sure the two views don't include the same node.

The attachment settings let you select which view you're attaching to, so attach the block. You'll also want the attached view to appear after the block view.

Ultimike has a good explanation of views attachment here: http://drupaleasy.com/blogs/ultimike/2009/07/using-views-relationships-a...

Yes, I did it and it work

jolly guy's picture

Yes, I did it and it work fine
am great-fully

can it be arranged

mbahlol's picture

hi can it be set just like nodequeue. i want to set only node with picture that display first, because not all my node have a picture.

Filter

jimsmith's picture

For the view that requires an image, set a filter for that. That way, only nodes with image = true will appear.

Newspapers on Drupal

Group organizers

Group categories

Topics - Newspaper on Drupal

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: