-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple non-invoking Shortcodes to render #281
Conversation
Thanks a lot for this PR @christianwach. |
@colemanw Sorry, I should probably have given steps to reproduce. The issue is that multiple Afform Shortcodes fail to render because their associated scripts aren't loaded. Try a page with the following content:
Without this PR, I get: With this PR, everything renders the way I'd expect it to. |
Makes sense. Code looks fine to me. If someone can test this out I'm happy to merge it. |
@colemanw Thanks for reviewing. I just realised that I missed the "single Afform Shortcode with |
@colemanw So it appears this can't be done because Afforms don't call I think this PR stands as-is, but definitely needs testing to verify that it supports my list of scenarios: Single post/page
Archives
And any other scenarios I may have missed, of course. The key thing for testing archives is that as soon as more than one invoking Shortcode is present (whether in the same post or separate posts) then all invoking Shortcodes should be rendered in preview mode. |
They do if you load them in standalone mode |
How do I do that? |
Well, if you're wanting to use |
@colemanw Ah right, interesting. It's not something that's directly relevant to this PR though is it? Or am I missing something? |
@christianwach I was just trying to answer your question about how to get the title to show up |
@christianwach is this good to merge from your end? |
@colemanw I've done a good amount of testing and this works. The issues I am having with multiple forms is the markup that It is an improvement, so let's merge and then see what we can do on the markup side. |
Overview
Addresses this issue on Lab
Before
Multiple Afform Shortcodes fail to render.
After
Multiple Afform Shortcodes render correctly.
Comments
The "non-invoking components" e.g. Afform can be extended via the
civicrm_no_invoke_shortcode_components
filter in case new Afform-like Shortcodes are developed.