Possible bug: nesting DC in post title

Hi!

The latest update that focus on ACF integration is absolutely awesome! I’ve been writing custom code for ACF for a while. With the power of the latest Pro-release, I can now get ride of 70% off all the custom code :grinning: Awesome job!

I do believe I’ve found a small bug in the last release, with regard to nesting DC.

{{dc:post:title post=\"{{dc:url:param key=\"group_id\"}}\"}}

The code above is expected to echo the title of a post_id that’s an url-parameter. Instead the result looks like this:
Mijn klassen\"}}
‘mijn klassen’ is the title of the current page. I think somewhere in the PHP code of Pro the escaping of such a nested shortcode is not handled properly?

Hi @dhunink,

Thanks for reaching out about this. Dynamic Content doesn’t currently support nesting. It’s just going to match the earliest available closing brackets. So this gets parsed: {{dc:post:title post=\"{{dc:url:param key=\"group_id\"}} and probably just uses the current post because that string doesn’t resolve to a post. Then you get \"}} tagged on afterwards because.

All that being said, nesting Dynamic Content is definitely something we’d like to explore at some point.

Hi @alexander!
Thanks for the clarification and I do appreciated nesting DC is something that’s on the horizon.
To be honest I expected nested DC to work, just because I was able to insert a DC-variable into a DC-field. Although I fully understand that feature request are being prioritized, I would like to make the suggestion to disable inserting DC-variables in places where they won’t be parsed correctly. May save a bunch of support requests :grinning:

Hi @dhunink,

I see what you mean. Of course you can use Dynamic Content multiple times in the same text field as long as they are adjacent and not nested - so we would have to actually detect the cursor position and conditionally enable/disable dynamic content. This gets somewhat involved and complicated so I think we’ll just leave it alone for now but definitely see your point here.