Search code examples
wordpresstinymceshortcode

Best theme shortcode implementations


I've been hesitant to pull the trigger on adding shortcodes to my theme and I'm currently testing some examples.

There are several ways to implement the shortcodes into the tinymce editor (from a usability perspective) and I'm looking for some examples that represent some of the better implementations you've seen.

For example, I could use a single button that opens a jQuery modal dialog window containing visual representations of all my shortcodes (similar to Optimize Press), or I could just list individual icons on the editor toolbar, one icon for each shortcode. I'm actually looking for an example of a hybrid approach using jQuery for enhanced usability.

Please share any insights or reference examples you have to themes which provide a good shortcodes implementation for users to apply shortcodes to their pages.


Solution

  • One of the most user friendly implementation for shortcodes I have seen, is the "Post Snippets" plugin which makes it very easy for any user to add customizable short code without having to write any code at all.

    The unique tinymce button, with a jquery ui tabbed modal window and optional variable boxes presented as form is a very good hybrid solution. The code is rather light, and seems quite solid.

    With its import/export options. I'd say it perhaps not even worth coding something yourself. You could simply tell your theme users to use this plugin and import your theme snippets.

    Or if you want your own custom thing, like I myself lean towards, you could fork that plugin's code while retaining its import/export capability.