I have a view block listing nodes. Let's say I have the following nodes (it's urls)
node/first-node
node/second-node
node/third-node
node/fourth-node
Then I have the view block listing this 4 nodes. This block is shown in the First sidebar in all pages.
What I need: when the block is shown at the page node/fourth-node, I need to arbitrarily exclude from the view block from the following nodes.
node/second-node
node/third-node
I need to do this in a way so that then after I can do the same thing with other nodes.
I thought of adding a field to the node called: "Exclude from view block at:" to be filled with the paths (one per line) where the node will not be listed in the view block (similar to blocks settings). Then I will need to modify the view.
Is this a correct approach? If so, what do I have to do in the view?
node/second-node
from the block if the url isnode/fourth-node
.hook_views_query_alter