I have 3 channels and relationships between them Theme >> Goal >> Issue where multiple issues can be a part of a single goal and multiple goals make up an issue.
I am flexible with which direction the relationships go (IE can have a single relationship from Goal to Theme or a multiple relationship to select multiple goals from the theme.
What I am looking for is a URL structure like example.com/red-theme/pretty-goal/balloons where red-theme is an entry in the Themes channel, pretty-goal is an entry in the Goals channel, and balloons is an entry in the issues channel.
I have a template group for issue with a template route: /{theme:alpha_dash}/{goal:alpha_dash}/{issue:alpha_dash}/
If I go to http://example.com/red-theme/pretty-goal/balloons I can successfully use channel:entries to get the balloons entry with {segment:issue}
{exp:channel:entries channel="issues" url_title="{segment:issue}" dynamic="no" limit="1" require_entry="yes"}
However - the problem I face - is that http://example.com/foo/bar/balloons also takes me to that page.
My Questions:
1) Am I going about this the right way or is there a better way to dynamically create urls?
2) If so, then how can I do a check for the proper relationship url_title
from the url segments to either redirect or throw a 404?
PS brand new to EE and appreciate any help/guidance.