This works:
{{ craft.entries.section('products').relatedTo(object).first.uri }}/{slug}
However, in this case, I need to use the extended relatedTo property, which includes curly braces:
{{ craft.entries({relatedTo: {targetElement: object, field: 'productConfigs'}}).first.uri }}/{{ object.slug }}
Because of the way renderObjectTemplate replacement seems to happen, the braces get screwed up.
Any way to work around this?
I'd actually rather do this in PHP/plugin if possible, but I'm not sure if a relevant hook/event exists.
Instead, this seems to do the trick:
– Tim Kelty Aug 09 '16 at 19:52{{ craft.urlFormats.yourSectionHandle(object)|default(object.slug) }}