Problems, need help? Have a tip or advice? Post it here.
15 posts Page 2 of 2
sorry I think this screenshot makes it clearer what the resulting code looks like and what the problem is with the modal window embedded in the <p></p>

modal3.gif
modal3.gif (51.39 KiB) Viewed 2736 times
Should just be a simple matter of continually adding to the buffer:
Code: Select all
<cms:capture into='my_buffer'>
    <cms:show my_buffer />

    ...
if the buffer is shown from within the shortcode in kfunctions.php the modal window markup is injected within the paragraph - so the frontend modal trigger/launch text isn't inline.

EDIT: when there are 2 modal windows it is only the last one that has the captured markup shown.
@potato, @cheesypoof has come up with the right solution.
Please do the following -
Your current code stands as follows (abbreviated)
<cms:capture into='my_buffer'>
<div class="modal fade" id="<cms:show k_page_name />" tabindex="-1" role="dialog" aria-labelledby="<cms:show k_page_name />Label" aria-hidden="true">
...
</div>
<cms:set show_buffer='1' 'global' />
</cms:capture>

Just add the highlighted line to make it -
<cms:capture into='my_buffer'>
<cms:show my_buffer />
<div class="modal fade" id="<cms:show k_page_name />" tabindex="-1" role="dialog" aria-labelledby="<cms:show k_page_name />Label" aria-hidden="true">
...
</div>
<cms:set show_buffer='1' 'global' />
</cms:capture>

That first stores the current contents of my_buffer back into my_buffer before filling it with new contents. This effectively becomes concatenating each shortcodes' output into a single buffer (as opposed to storing only the last output as was previously happening)

Please try it out - it works :)
Yes it works! Thanks! I'd put <cms:show my_buffer /> in the wrong place not realising its functionality.
15 posts Page 2 of 2