Create rankings of nodes based on integer field and show that nodes ranking compared to all other nodes

Created on 4 April 2024, about 1 year ago
Updated 24 April 2024, 12 months ago

Is this possible with eca?

I have 200+ nodes based upon running races and I have listed them in a table and sorted them by longest distance to shortest distance, so the longest are at the top and then in descending order.

At the beginning of each row is the position of that node in the table, 1st, 2nd, 3rd, and so on using View Result Counter.

What I want to do now is show this block on each race node but I want to show only the row that represents that node it is on.

This way I can duplicate this for other data points such as elevation, how many climbs and other numerical fields and show on this node the following data:

This race is the fifth longest out of all races

This race is 10 out of 200 for elevation

This race is the 20th cheapest

Second question, is it possible to also do this without the use of a table, but instead unformatted list and some other counter/results positioning of that data compared to other nodes to get the above results?

💬 Support request
Status

Fixed

Version

2.0

Component

Documentation

Created by

🇬🇧United Kingdom effortDee

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @effortDee
  • 🇩🇪Germany jurgenhaas Gottmadingen

    My first thought is that the views module is producing those "rankings" at the render level, i.e. very late in the process. So, every approach that would try to shortcut that process would actually lose out that most important information. In other words, you need views to do the full processing and then afterwards hide those parts that you're not interested in.

    That said, hiding the unwanted rows can either be done with some post rendering or with CSS. While manipulating an existing render array with ECA can become pretty complicated, if even possible, hiding the unnecessary rows with CSS might be the much simpler approach in this context. You would have to add some context related classes to the views rows, so that your css can make the decision on what to hide and what to show.

    That approach should work with tables and other formatters, as long as the rows are identifiable by css selectors.

    Unfortunately, that doesn't sound like a task for ECA.

  • 🇬🇧United Kingdom effortDee

    Thankyou, i appreciate the reply!

    I was just seeing some vague ideas as how to implement this across the web with mentions of Rules so thought I would ask here as I have not used ECA yet.

    Again, thanks!

  • Status changed to Fixed 12 months ago
  • 🇩🇪Germany jurgenhaas Gottmadingen
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024