jtsternberg / Shortcode_Button

Tinymce and Quicktag buttons for outputting shortcodes. Built to work with CMB2.
81 stars 7 forks source link

Editor button to open popover with multiple child buttons #11

Open jasondavis opened 8 years ago

jasondavis commented 8 years ago

The ThemeFuse Unyson framework has a shortcode modal like this image below.

  1. Click editor button
  2. Popover is shown (like image below) which allows you to click on a shortcode type.
  3. Popup Modal window is opened with shortcode settings for the selected shortcode type

chrome_2016-07-13_07-15-47

chrome_2016-07-13_07-51-26

Looking at the Unyson shortcode library https://github.com/ThemeFuse/Unyson-Shortcodes-Extension , it is really complex as it requires the core framework for the shortcode library to work. But then inside the shortcode library codebase it has a folder which contains afolder for each shortcode which then has a few files to define the shortcode modal window settings, the template for the shortcode view. So it is modular allowing to create new shortcodes by simply adding a new folder/files to the library code.


The Shortcode_Button library is like this as far as I know...

  1. Click editor button
  2. Popup modal window is opened with shortcode settings

In order to add 5 shortcodes, it would require 5 shortcode editor buttons.

So how difficult would it be to make 1 button which could show a popover with multiple buttons which each would act just like the current button does but instead would allow to create multiple shortcodes and contain them in a popover?

I have seen some other frameworks do this as well which didn't have the popover of icons like Unyson did above but instead had a list of shortcodes to select inside the modal window which would then rebuild the modals HTML with the selected shortcode settings.

jtsternberg commented 8 years ago

So how difficult would it be...

Likely a day or 2 worth of effort. But I don't think you'd want that to be the default. I think you'd need to introduce the concepts of optional groups.. so you can add a button directly, or to a group.

JiveDig commented 7 years ago

+1 on something like this. Another (possibly simpler but not as pretty) solution would be a dropdown menu when you click the button, if multiple shortcodes are registered to the same button.

andrewatduckpin commented 5 years ago

+1 on this. Will probably try to rig something up in the meantime, but would love to be able to group buttons out of the box!

JiveDig commented 5 years ago

With Gutenberg about to drop I'd guess shortcode related things will get left in the dust.