In your second example, you use:
[text color="red"]This is red text.[/text]
What if This is red text. is dynamic content? Take for example, a wrapper element.
HTML:
<div class="wrapper"></div>
Shortcode:
[wrapper] My dynamic content that could contain lots of HTML from the user [/wrapper]
How would I go about this? For example, My dynamic content is injected within <div class="wrapper"> My dynamic content </div>?
Maybe I'm overthinking this, but I want to use this in a WYSIWYG and I know a very similar service for Laravel lets you access the $content within the tags which renders anything between the shortcode tags.
The idea I have in my head is:
<div class="wrapper">{{ content }}</div>
Thus dynamically rendering the content between [wrapper] and [/wrapper].
Is there a way to achieve this or access the content within the shortcode tags?
I'm going to take a slight guess and presume this may involve passing the content as a controller argument somehow?
It's not that I want to inject content as such by parameter, but HTML pre-existing through the WYSIWYG.
Cheers,
J
In your second example, you use:
What if
This is red text.is dynamic content? Take for example, a wrapper element.HTML:
Shortcode:
How would I go about this? For example,
My dynamic contentis injected within<div class="wrapper"> My dynamic content </div>?Maybe I'm overthinking this, but I want to use this in a WYSIWYG and I know a very similar service for Laravel lets you access the
$contentwithin the tags which renders anything between the shortcode tags.The idea I have in my head is:
Thus dynamically rendering the content between
[wrapper]and[/wrapper].Is there a way to achieve this or access the content within the shortcode tags?
I'm going to take a slight guess and presume this may involve passing the content as a controller argument somehow?
It's not that I want to inject content as such by parameter, but HTML pre-existing through the WYSIWYG.
Cheers,
J