I'm trying to create dynamic urls for a channel or structure section that depend upon the url structure of a different structure (or the first entry in that structure). For example, if the main structure has "foo.com/news/" I want the 'news' channel entries to have urls of "foo.com/news/{slug}".
I came across this question/answer which seems like a great solution: Dynamically setting a channel's Entry URL Format with Craft tags However, like mentioned it's not really dynamic as you need to go back and resave if the parent slug changes. I started doing this and it's turning into a disaster.
Has anyone found a way to do this completely dynamically? Would routing be the right way and how would it be done (I have not used routing)? Or backwards relational entries from the channel to main structure (which seems much less intuitive from CP UI perspective)?
...and if you don't have any ideas, HOW do you deal with urls when you have a 'pages' structure and linking from that to a channel? Based on extensive research, this seems to be the best way of blending structures and channels but my site is too large and complex to hard-code the url structures for the outlying channels/structures.
I don't have the rep to comment on the post above, hence the new question. Thanks much in advance!
****See my comment below gioppe's answer. I have decided against using this dynamic url approach, as explained in my comment.