wp-shortcake / shortcake

Shortcake makes using WordPress shortcodes a piece of cake.
GNU General Public License v2.0
664 stars 142 forks source link

Display shortcode help and name on Insert Post Element #120

Open bobbingwide opened 9 years ago

bobbingwide commented 9 years ago

When you're working on the Insert Post Element dialog it can be difficult to know which shortcode you're actually working on. I propose a couple of improvements.

  1. The shortcode tag, as well as the shortcode label should be displayed. e.g For WooCommerce's [best_selling_products] shortcode, the tag is best selling products and the label is 'List best selling products on sale'.
  2. This information should be accessible from the 'list' display of shortcodes, perhaps using a tooltip.
  3. Having chosen a shortcode to work with the specific shortcode's details should be obvious on both the Edit and Preview panes
  4. The display should support a detailed view as well as the grid view.

Note: This is the first of quite a few requirements that I intend to raise. The first 18 are summarised here.

http://herbmiller.me/2015/01/30/oik-shortcake-new-ui-creating-oik-shortcodes-using-shortcake/

danielbachhuber commented 9 years ago

the label is 'List best selling products on sale'.

Where is this label defined?

This information should be accessible from the 'list' display of shortcodes, perhaps using a tooltip.

I like this idea.

Having chosen a shortcode to work with the specific shortcode's details should be obvious on both the Edit and Preview panes

Can you share in a wireframe what this might look like?

The display should support a detailed view as well as the grid view.

Not sure I follow what would this contain. Can you elaborate with a wireframe?

bobbingwide commented 9 years ago

Re: Label.

In my solution for the oik base plugin ( github.com/bobbingwide/oik ) the text that I propose for label is returned as shortcode help. I tried using the shortcode tag and label in the label parameter to shortcode_ui_register_for_shortcode() but, with the current styling, this is too long.

image

bobbingwide commented 9 years ago

Oops, didn't mean to close.

bobbingwide commented 9 years ago

Replacing "Insert Post Content" with the shortcode label and tag image

Also note that the label for each parameter contains the parameter name and a short description.

bobbingwide commented 9 years ago

The detailed view would be similar to the Media Library List View Columns would be: icon image, shortcode tag, label and and other relevant values. In oik, I have an admin page - oik options > shortcode help image

Here the link in the Help column opens up more help for the shortcode, with an example and the generated HTML snippet for the example. The example is not quite a preview since it doesn't allow user interaction.

The links in the syntax column lead to the shortcode catalog, where further examples and explanations are documented.

mattheu commented 9 years ago

Discussed this in the weekly meeting on slack.

matth_eu I’m not keen on exposing the shortcode… Tooltip i’d be OK with but not sure its all that useful We could allow for some customizable shortcode description? Just a bit more info on what you are actually adding?

I think allowing a shortcode description that is displayed before the form might be useful. Something to give a bit more info than the name and icon.

bobbingwide commented 9 years ago

The shortcode name ( best_selling_products) is the thing that remains constant. It's what the user sees in text mode and what's shown if the shortcode UI is not active in Visual mode.

In my scenario the parameters are exposed with the parameter name, default and other possible values and a brief description of each.

Since I provide links to additional documentation then I don't provide any additional information regarding parameter combinations, but in a system that doesn't provide link this information might be needed.

This example is of a fairly simple WooCommerce shortcode. Some of my shortcodes, being closely mapped to WordPress APIs, are more complex than others. There's a potential for a lot of documentation and examples.

danielbachhuber commented 8 years ago

Moving this to v0.7.0

MickeyKay commented 7 years ago

@goldenapples I see this was removed from the 0.7.0 milestone. Is there any more context around why this was done? Any updates on this feature request? Thanks!