How would I go about putting an image/link/text (awards badge), anything that shows that a specific food item makes the top 3 of one of this views? https://www.outdoorfood.club/food/award/protein-bars-low-in-fat

So this view is an awards page, the top 3 food items are there because I have filtered for food item content type and then sorted by least amount of fat (integer field). I have then limited the view to 3 items, which gives me the top 3. (this may be a problem later)

The problem I have is that this list will continue to grow as I add more food items, so i may not look at it in months but i'll add loads of new protein bars and some may even replace the top 3 that sit there at the moment.

What I want is the Tanka bar, or the 2 life bars to have an award logo on their own node page stating they have won an award in X view, which is the page i've linked to above.

Then as i add new protein bars, if a new one comes in 3rd then that gets the awards badge and what was third automatically loses it.

Solution Idea

What i'm thinking is to duplicate the top 3/best 3 view and then put that block on to every food item. It will look different of course but if it finds itself on it's own page with a relationship/contextual filter (on a taxonomy term that is a copy of the nodes title) then it will show the new view, the awards badge.

I think views can do this, but some guidance would help.

So far I have managed to create a 'related content' view block but I can't limit it to just the top 3 that appear on this view. What other filter or thing could I do to achieve this? As I believe then I should get what I'm after.

  • Have you tried using the Sticky property of your nodes in combination with sorting by sticky in your view? – Beau Aug 29 '18 at 23:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.