Double Enclosed Content
-
Hi, is it possible to use
$$enclosed_content$$more than once in a Shortcode?
-
Hi @meir321,
Yes, we can use multiple
$$enclosed_content$$placeholders inside the “shortcode content”.But all the placeholders will have the same value i.e because there is only one way to set a value (
[sc name="abcd"]My content value[/sc])Thanks,
AakashThanks for letting me know. It would be a nice feature to have the ability to add multiple unique values.
Hi @meir321,
Cheers ! Since we can pass only one “enclosed content” (i.e
[sc name="abcd"]My content value[/sc]) this is the only way to do so.If you looking for more variables to pass, then you can try the custom parameters feature.
More details here – https://www.aakashweb.com/docs/shortcoder/custom-parameters/
Thanks,
AakashHi, thanks for the response. Custom parameters seems like what I need, but in my tests when I inserted a shortcode that had custom parameters setup into a page, the custom parameter does not show up. For example, I setup a parameter:
[iframe src=”%%URL%%” width=”100%” height=”%%height%%”]
But when I insert this shortcode into a page, instead of getting;
[sc name=”iframe” URL=””, Height=””]
I get the following:
[sc name=”iframe” ][/sc]
Please advise, thank you!
Hi, I’m following up, is there something to do about this? Thank you!
Hi @meir321,
Sorry for the delay. I missed to follow up on this.
The default value for “custom parameter” is an empty value. There is no difference in setting empty value or not adding the parameter itself.
So it is not necessary to explicitly to set a value for the custom parameter to the shortcode.
Hence, the “insert shortcode popup” does not add them to make it simple.Please let me know if I had answered your doubt.
Thanks,
AakashHi, thanks for your responsee. If I do want to add a custom value every time as in my frame example, is there a way?
Thank you
Hi @meir321,
Yes, you can simply type them out or use the “insert shortcode popup” where you can fill the value for the custom parameters present in the shortcode content.
Thanks,
AakashI didn’t notice that dropdown option. Thank you for letting me know!
Cheers !
The topic ‘Double Enclosed Content’ is closed to new replies.