-
Notifications
You must be signed in to change notification settings - Fork 143
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
Enclosed shortcodes #129
Comments
Yep, agree. |
On the topic of enclosed/nested shortcodes: I just discovered Shortcake - love the concept and implementation - and started to explore how to integrate my plugin's shortcodes - and I've got several nested ones. An example of a basic syntax is:
I was able to register the parent shortcode, get an input form via Add Media with parameters and inner content as text area, and insert the generated result into the post. The rendered result in the visual editor is perfect, such a superior editing experience than seeing all those shortcodes raw. However, when I click to edit the block, the inner content doesn't appear in the text area (it's blank). Here's how I'm registering it:
I saved the post, but when I go to edit the inner content, the text area is still empty - and nothing in the Preview tab. It is displaying the result fine in the visual editor. |
I traced it down to: At the start of the function, variable So it seems that I realized this is the same issue as #126. |
Some examples of how Shortcake can royally screw up manually-entered shortcodes (since Shortcake doesn't natively handle these scenarios properly): Demo 1:
The Demo 2:
The |
Ideally, I'd like to see Shortcake's previewer be smart enough to handle nested shortcodes with both parent and children shortcodes editable via UI (not just the parent with a free-form These more complex shortcodes are exactly what UIs are useful for. Instead, I find myself just registering shortcodes without tying into Shortcake or, if they do, returning blank if This has become my Number 1 issue with Shortcake. It's hard for me to say,
I don't know the solution, but I'm hoping to bring more attention to this problem. |
Thanks for the additional details, @cliffordp.
Supporting editing interfaces for nested shortcodes is outside the scope of the project. However, Shortcake shouldn't be clobbering that data. |
Glad we can at least agree that
👍 |
👍 want to see data mangling get fixed, very frustrating currently. |
I think that support for nested views for shortcodes are the answer for how WordPress core will be able provide a UI similar to the many page builders out there, like Visual Composer. Consider shortcodes that represent rows and columns. This paired with the ability to drag-and-drop shortcodes (#51) will make this super compelling. |
Is anything being done about this? |
@westonruter Yes and bundled with the customizer, the core will finally have a front end page builder provided by live shortcodes, widgets, menus and even theme/site options. This is exciting times. |
Just watched @khromov's video introduction. Got to wondering where this particular issue is at 8 months later from last comment? |
Some shortcodes require the content to be enclosed between shortcode start and end tags.
It should be possible to identify these shortcodes using a mechanism other than using a labelled parameter of 'content'.
Conversely, it should be possible to identify shortcodes that DO NOT SUPPORT the $content parameter. So if I have manually created a shortcode like this
[my-shortcode]Some awesome inner content[/my-shortcode]
and my-shortcode does not support nested content, then my mistake should be reported to me.
This is related to issue #93.
Note: In my shortcode catalog I have a checkbox field labelled 'Enclosed content shortcode' where this information is registered. The value is displayed in the Information but is currently unused in the code.
The text was updated successfully, but these errors were encountered: