2

What would be the best way to select and display featured entries? For example, if I want to choose at least 3 entries to feature in a sidebar apart from the main content?

1

I would suggest using a custom category OR a lightswitch field like it's described in the documentation.

Personally I would go with a category since you can fetch the entries for that particular category directly. With a lightswtich (I think) you need to fetch all, then run a if-statement to see which is selected.

  • You can fetch entries with lightswitch on like so: craft.entries.myLightSwitchName('1').find(). One advantage of the category solution though: you could add subcategories and other more complex stuff. For a simple solution (UX wise) I'd go with a lighswitch. – carlcs Aug 24 '14 at 13:49
2

It always depends on your needs, so there is not really a best way to do feature entries, at least if you don't give more specific info on what your exact situation is.

To have a nice overview of which entries are featured, you could add a new section (structure or channel), with an entries field to collect the entries you want to be featured.

Another idea would be to collect the feature entries in a global set using matrix. You need just a single block type, again with an entries field to make the relations.

A Matrix field or a structure section enables you to (optionally) re-order the entries to your liking.

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.