- This topic has 3 replies, 2 voices, and was last updated 6 months, 3 weeks ago by
David.
-
AuthorPosts
-
September 9, 2022 at 6:06 am #2337942
Matthew
It would be really useful to have a shortcode where we can display a block element anywhere we like, without connecting it to a hook. All major theme builders do this already (e.g. Elementor Pro). And what is GeneratePress Elements if not a theme builder.
Yes, I’m aware of this shortcode solution:
https://generatepress.com/forums/topic/block-element-inside-another-block-element-content/#post-1904275However, it requires a separate shortcode for each block element, and it would cumbersome to manage more than a handful.
Instead, why not create a universal shortcode where we can insert a block element by its id?
e.g.
[block_element id="42"]
September 9, 2022 at 7:03 am #2337995David
StaffCustomer SupportHi there,
Thanks for the suggestion, its great to hear this kind of feedback.
First thoughts would be – we add a GP Block to do it, instead of a shortcode.
Question; how would this differ or add benefit over say using a Reusable Block?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 11, 2022 at 12:12 pm #2339877Matthew
You make a fair point about reusable blocks David. The percentage of situations where a shortcode is useful and reusable blocks is pretty small.
In this case, I’m looking for an easy workaround to design a mega menu using Generateblocks, which I can then inject into the traditional menu UI using a shortcode.
I also use the classic widgets plugin (the block-based widget UI annoys me).
Another use case would be to inject block elements into a plugin that isn’t fully Gutenberg compatible.
I guess my feeling is: if it’s easy enough to do, why not add it. A percentage of your customers will find it valuable.
P.S. The pace of support requests is pretty incredible these days. Credit to you and the team on being able to address most/all of them. The growth of GeneratePress has been incredible.
September 12, 2022 at 4:09 am #2340369David
StaffCustomer SupportNOTE regarding block widgets, you can disable them without a plugin:
https://docs.generatepress.com/article/disable-the-block-editor-in-widgets/
Our biggest issue with shortcodes / blocks that are built into the Theme is that it can lead to theme lock, as switching theme means the “loss” of that content and redundant code is left in the post content, that may require manual removal. This kind of theme / plugin lock is something we try our best to avoid.
The Navigation Menus, thats a real tricky one.
If shortcodes in menus work for you, then the best we can offer at the moment is the shortcode method that Elvin provided here:P.S thanks for the kind words, although we have been a bit slow this last week as we decided to let people to take holidays lol 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.