I have a simple content type that has a "parent" field on every content type. This parent field is shown by an entity reference in each of the other associated content types. If there is a parent content type then you can associate these other content types to it.
Using views, I have page that shows all the results of "notes" for example. Notes has a parent associated with it that must be selected when you create a new note. So every note has a parent.
I have been attempting to show all the notes of a certain parent through the URL like so (i have pathauto and alias' setup):
committees/parent/notes
Using contextual filters and entity reference (parent) I am attempting to show these notes based on parent context. I have under relationships: Entity Reference: Parent and under Contextual filters (Content entity referenced from field_parent) Content: Parent. When I preview this in the auto preview area, nothing shows. For example a parent name is "fire" and I enter it in the preview contextual filter and nothing shows.
I have it setup like so:
When the filter value IS NOT in the URL:
Checked Provide Default Value
Type: Raw Value from URL (URL is committees/parent/notes)
Path Component: 2 (parent)
Checked - Use Path Alias
When the filter value IS in the URL or Default Provided:
Checked - Specify Validation Criteria
Selected - Validator: PHP Code
PHP Validate Code:**
$handler->argument = str_replace("-"," ",$argument);
return true;
However using Contextual filters (Content entity referenced from field_parent) Content: Nid and then put in the node id of the parent (fire in this case), I am able to see the notes for "fire" for the certain parent node id (which is the same as fire just the nid). This is exactly what I want.
What am I missing here for the parent to be referenced in the URL and show the notes based on that parent? Why does the NID work and not the PARENT found in the URL?