Contextual Filter Path Alias I searched for this for some time now but couldnt find an anwser. I am using drupal 9.1.5 and pathauto. I have content types department and depratment news. The news are linked to the department. So whenever you create a department news you link it to a department. Now I want to display all depratment news linked to the department when i am on the department page (all children) and when I am on a page of a children (department news) I want to display all siblings, i.e. all departments news linked with the same department.
My url for departments is
[node:title]
and for department news is
[node:field_department:entity]/[node:title]
I thought that using a contextual filter in my view using the raw value from the url would work. So I used path component 1 and checked to use path alias. However this does not display anything.

When using path component 2 and disable to use path alias it works for the department news, which makes sence as I am internally on page node/xxx. I was so frustrated that I tried every other combination of path component and use path alias but nothing works. When using a fixed value for a department everything works as expected for that specific department
You can search for examples for each of your questions with &quot;backwards views&quot; and &quot;sibling views&quot;. In short:
Show children on parent page
Create a Views that lists Children, then add the Entity reference field as the Contextual filter (not Content ID). Configure it to Provide default value Content ID from URL.
No Relationships needed in this solution. Place the Block on Parent pages and don't forget to configure the Block contextual option, it won't work without it.
Show siblings on child page
Create a Views that lists Children. This time you'll need 2 Relationships and 1 Contextual filter, all sequentially linked.
The first Relationship is for your ER field (the Field on Child that references a Parent), this one introduces the Parent info.
The second Relationship is the &quot;backwards&quot; Relationship for the same field, it is named a bit differently that the &quot;forwards&quot; one. Make the second Relationship use the first Relationship. This will trace path &quot;backwards&quot; from Parent to all their Children.
Add the Content ID Contextual filter and make it use the second Relationship. Configure it to Provide default value Content ID from URL. This will tell Views which Child's page you're currently viewing and will match to the Parent and then Parent's children.
Exclude current Child from Views
Your current Child will also be listed in Views because it satisfies the same condition! (It's also Parent's Child, just like other Siblings.)
You can exclude it by adding the second Contextual Content ID Filter that doesn't use any Relationships, Provides default value Content ID from URL, but under the last section More also check Exclude.