2

I have a content type named "Story" with a boolean field "Featured".

When users create/edit a story they can check the featured checkbox. Stories that are featured appear in a block throughout the site. The block only shows two stories.

Ideally, if there are two stories featured and a user creates a new story and selects the featured field, it would deselect the featured field for one of the two original stories. Only two stories can be featured at once. Is this possible?

The traditional route is to have the views block show the two most recently created stories that have the featured field selected. From an administrative perspective I want to make it easy for site editors to keep track of what's featured (these users are new to web publishing) so it'd be great if there was a limit on the number of nodes that can be "featured".

Any thoughts are appreciated! Thanks!

1

A view can be used with a limit on the number of items to two with a filter that requires that story to be featured, then sorted by publish date (descending to show the latest). Otherwise, if you want an administrator to have total control over exactly which two stories are featured, use Nodequeue or use the node sticky bit and make sure only admins have access to set the sticky bit.

You can reuse the same view to create a page view that shows all stories that have the featured flag set.

  • Thanks, but I'm looking for a way to limit the number of nodes that can have a boolean field selected. – felix Oct 28 '12 at 1:57

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.