I have a view that lists nodes of a certain type "TypeA" using their titles (and a link to click on).
The view filters out the current TypeA node from that list using a contextual filter set to Content:ID with a default value passed in through the request URL, and the "Exclude" checkbox ticked.
Consequently, when the currently displayed node is not of TypeA, all nodes of TypeA are listed.
I want the block in which the view is displayed to change title depending on whether I view a node of TypeA or not, as follows:
- Node is of TypeA, the title is set to "Other TypeAs"
- Otherwise, the title is set to "All TypeAs"
I don't know how to further test the query result for the condition, or change the contextual filter (since I always have a Content:ID passed in) to make that happen.
One possible workaround could be to trigger on the URL path because all nodes of TypeA have a custom URL path (via the Pathauto module) configured.
I am using Drupal 8.4.6, soon to migrate to 8.5.