views:

62

answers:

1

currently:

i have a page view that is displaying all content that is flagged as "not featured" with a simple CCK dropdown.

the attachment to the view displays all content that is "featured" and is styled to be a little more impressive.

what i'd like to be able to do is have a few, say 3, featured items display at the top in the attached view, and display all content, whether featured or not in the view below, excluding the 3 displayed in the attachment.

what would be the simplest way to achieve this using the Views UI and perhaps a custom module or two if neccessary?

i'm using Drupal 6 and Views 2

+1  A: 

There are multiple ways of doing this. Here are some alternatives

  1. (Using your approach) My understanding is that you are using a CCK Select list field (lets called it FState) which has a state "Featured". Essentially you need to show items that are featured in the attachment display and show items that are not featured in the page view.
    • In the attachment view you should add a filter which will be Content: FState = Featured. You can do this by choosing the Content group in the Views filter drop down. Choose Content: FState (field_fstate) - Allowed values. Select Featured. Make sure the operator is is one of
    • In the page view do exactly the same thing except make sure the operator is is none of
  2. If I were to do this myself I would use a nodequeue module ( http://drupal.org/project/nodequeue ) for featured content. For my attachment view I would ensure that the items were in the nodequeue and for the page view I would ensure that the items were NOT in the nodequeue (using the correct filter). There is plenty of material available on the internet on using nodequeue and integrating them with views.
  3. Another alternative is to use the Flag Module ( http://drupal.org/project/flag ) though I suspect nodequeue will be a better match for you.

Edit: Based on your comments I understand your requirements better. Perhaps you are mixing some language together that can be potentially confusing to an outsider. When you say "featured" content, that means that the content is shown specially. So it is confusing, perhaps, when you say that "featured" content also appears in the page view along with unfeatured content.

Anyways in summary here is what I understand what your requirement is now (continuing to use "featured" in the way you mean it)

  1. You have two views: An attachment view and a Page View. The attachment view is a little bit more attractive.
  2. A news article that appears on the attachment view does NOT appear on the page view
  3. Lets say the attachment view has space for 4 articles
  4. Occasionally you mark articles as "featured". The 4 latest articles that are "featured" appear in the attachment view. On the page view, all news articles are also shown in chronological order regardless of whether they had been marked as "featured" or not in the past. The only condition is that there should be no repetition between the attachment view and page view.

There is a slight doubt in your specification....forget about your CCK select field for a second. My question is: Do you want to (a) Simply show the 4 latest "featured" articles in chronological order in the attachment view or (b) Do you want to explicitly determine the items and their order in the attachment view?

In case (b) you can have the luxury of choosing an article that was perhaps 1 month old because it was a spectacular article and you still want to keep showing it. In (a) you don't have that flexibility. As new "featured" articles are made, the old ones move out from the attachment view.

Of course for cases (a) & (b) the articles that are shown in the attachment view will not appear in the page view (this should always holds true).

For case (a) you should use nodequeue module for the attachment view and for case (b) you can continue using the CCK Select list method to pull out featured articles as you do currently for the attachment view. To prevent duplicates appearing in the page view use the http://drupal.org/project/views_unique or http://drupal.org/project/views_exclude_previous modules

Sid NoParrots
thanks for that, although it's not *quite* what i was looking for. I'd like featured nodes in the main view, with non-featured AND featured nodes in the attachment below it, but without duplicate items being shown.
David Meister
additionally, the view works by using arguments to sort content into categories such as "music, arts, etc" from the url. There's around 10-15 new articles uploaded a day, so manually sorting them isn't an option.
David Meister
@David: See comments above
Sid NoParrots
will look into views exclude, from the description it seems to be exactly what I'm looking for. Thanks again :)
David Meister