Skip to main content
deleted 5 characters in body
Source Link
Aaron
  • 1.4k
  • 1
  • 9
  • 10

Implement something like hook_views_pre_render() or hook_views_post_execute() and, every time your "Top 3" view is executed have your code will just iterate over the results and update the "Highest Ranking" field for each of the nodes in the top 3 as needed.

The only downside of this is that if your "Top 3" view is rarely ever executed then it's possible that a node could move into then back out of the Top 3 without the view ever being executed and thus without your code ever recording the node's presence in the top 3. If you want to try to avoid this you might implement hook_cron and programmatically call your view every time cron is run.

Implement something like hook_views_pre_render() or hook_views_post_execute() and, every time your "Top 3" view is executed your code will just iterate over the results and update the "Highest Ranking" field for each of the nodes in the top 3 as needed.

The only downside of this is that if your "Top 3" view is rarely ever executed then it's possible that a node could move into then back out of the Top 3 without the view ever being executed and thus without your code ever recording the node's presence in the top 3. If you want to try to avoid this you might implement hook_cron and programmatically call your view every time cron is run.

Implement something like hook_views_pre_render() or hook_views_post_execute() and, every time your "Top 3" view is executed have your code iterate over the results and update the "Highest Ranking" field for each of the nodes in the top 3 as needed.

The only downside of this is that if your "Top 3" view is rarely ever executed then it's possible that a node could move into then back out of the Top 3 without the view ever being executed and thus without your code ever recording the node's presence in the top 3. If you want to try to avoid this you might implement hook_cron and programmatically call your view every time cron is run.

Source Link
Aaron
  • 1.4k
  • 1
  • 9
  • 10

Implement something like hook_views_pre_render() or hook_views_post_execute() and, every time your "Top 3" view is executed your code will just iterate over the results and update the "Highest Ranking" field for each of the nodes in the top 3 as needed.

The only downside of this is that if your "Top 3" view is rarely ever executed then it's possible that a node could move into then back out of the Top 3 without the view ever being executed and thus without your code ever recording the node's presence in the top 3. If you want to try to avoid this you might implement hook_cron and programmatically call your view every time cron is run.