Ah, thanks, close! I enabled that before to display the values at all, but it doesn’t help with the execution of the code snippets in frontend rendering. I’m sure I’m missing something. Appreciate the help.
You might want to use a shortcode instead and then whitelist it with this:
We currently don’t allow return functions for security reasons.
Frontend rendering will be revised in the future, but currently shortcodes are the best solution.
I appreciate it’s not as straightforward as it should be.
Can you try using this dynamic selector to display the shortcode instead of the dynamic inserter?
Thanks for taking the time @Louis, indeed, it wasn’t working because I expected a paragraph with the shortcode written directly to work, so when using the “proper” shortcode insertion method it worked great.
I used a paragraph with the shortcode written directly in another instance (outside a query) and it worked, so I had that expectation.
@luissantander, could you share the “proper” method you ended up using in a bit more detail?
Sorry for reopening this thread, but I’m having the same problem and I can’t seem to find the “proper” method for shortcode insertion. I am able to insert the shortcode using the dynamic inserter on a cwicly paragraph block, but – as you also noted – that does not work with frontend rendering turned on (which I need for filtering).
When I try inserting the shortcode via the dynamic selector @Louis suggested, there’s no option to select shortcode as the source. Is it tucked away or do I need to enable it somewhere?
Hi @marc, at first I just hardcoded the shortcode in a paragraph block, which worked on regular pages. But on a frontend rendering query, that didn’t work, instead you’re supposed to add a dynamic tag with the “+” icon and select Shortcode, and add it from there. Hope it’s clear!
Hm, that’s strange, I already tried that – with no luck, unfortuantely With frontend rendering turned off, everything works fine. But with FR enabled, the cwicly paragraph block is empty on the frontend.
I also tried both methods of inserting shortcodes via the dynamic inserter showcased this post. The “old” one returns an empty paragraph and the “new” one crashes the whole query (no posts are displayed at all, querytemplate full of divs with class cc-loading-skeleton-top) returns the following error in my browser’s dev console:
[Error] Unhandled Promise Rejection: SyntaxError: The string did not match the expected pattern.
promiseEmptyOnRejected
promiseReactionJob
I’m kinda lost because I feel like I tried everything in my power, but I’m also new to queries with frontend rendering, so I’m probably missing something
For you it worked fine without further adjustments, right @luissantander?