I'm trying to load an entry based on the following url:
/artists/nameOfArtist/nameOfCategory/myEntry/thumb
This URL follows the structure of my entries: Artist > Category > Entry
So, I'm thinking that something like this should work:
{% set project = craft.request.getSegment(-2) %}
- This gets me the variable from 'myEntry' segment.
{% set artistParent = craft.request.getSegment(-4) %}
- This gets me the variable from 'nameOfArtist' segment.
Then, I want to find the 'project' entry that lives under 'nameOfArtist'.
{% set entry = craft.entries.slug(project).descendantOf(artistParent).first %}
but this is not working. What am I missing? Or is there a better way of doing this?
category
and not just another structure entry?