Forum
Apply featured attribute to one item at a time
Hi guys, I'm just building a site using Perch that has a portfolio section. I've followed the video guide in the docs and so far everything is working great, however I'm just trying to figure out the best way of having a 'Featured' project which I'll output using a different template.
I'd like the 'Feature' attribute to only be applied to one portfolio item at a time, i.e. if the editor applies Featured to a new project it removes it from the previous item that had it. Is that possible? What would I use to do that? Categories?
Thanks.
Hi Alan, I don't think there is a way to force only 1 item to be featured at a time. However, there are a few of things we can do to make it work pretty well:
1) Firstly add a 'Featured Project' checkbox, I've added 'help' to encourage the editor to try to keep to just 1 featured project:
2) Use
count
withperch_content_custom
to only show 1 featured project. So even if more than one are marked as 'Featured' only one will show:3) In 'Region Options' uncheck 'Edit all on one page' to show the Projects in listdetail mode (rather than singlepage) and add in
featured_project
to the 'Item list column IDs' (along with the_title
and perhapsimage
). This will show the editor at a glance the item(s) that have been marked as 'Featured'.I hope that helps.
I think Simon has covered everything!
:) thanks boss.
Hi Simon, thanks for that. That sounds like the perfect solution actually! I'll give that a blast!