Shortcode Grab Bag

7 Responses to “Shortcode Grab Bag”

  1. Keith says:

    I see what’s wrong. I’ll try to get a fix out in a day or so.

    Keith

  2. Dennis Todd says:

    Keith,

    I’m using ShortCode GrabBag to link terms on my blog to wikipedia (gbwiki shortcode).

    I’ve just noticed that single word terms work fine, but multi word terms fail. I’m bummed.

    Here’s a page:

    https://pls-demoapp.gisinfosystems.com/tour2/?p=1000

  3. Keith says:

    I was going to add a filter to the plugin. Each plugin that wanted to use the interface could hook my filter. I would then use apply_filters to get back a list of the grab-bag.xml files in each plugin. All a plugin needed to do would be to pass the file name to the filter when the apply filter called them back.

    I am writing code to parse the xml and create the help screen from the xml files.

    I would like to write a generic include php file that any plugin could use without having to load the grab bag plugin. I could load that on github and perhaps better coders than I could work on it.

    I tried the jQuery code you gave me and it works well. I will have a new version of the plugin out soon. This week is shot because of the holiday, but I should sneak in some development time soon.

    Keith

  4. Zafrir says:

    jQuery is included in WP core and is very easy to use, with next to none learning curve.
    I’m using many shortcodes and started to think about writing something like this, so before coding I looked for similar plugins, found it. Its great idea!
    Your drag and drop idea is better than editor menu, since you can see all the plugins and drag and drop. The only thing I’m thinking about since I found it is the way to make it generic: should enable to add description and parameters to any shortcode in a convenient way. my idea is to use WP thickbox and on shortcode click event to open the thinkbox to put in the parameters for the shortcode, if the shortcode does not have a description and parameters list to enable to add it, there are some plugins that add a editor button that is doing the same. All the data tructure should be saved as option of this plugnig (using serialize/unserialize for saving array as option) and it should include the most popular plugins shortcodes data to begin with.
    My suggestion for data structure is:
    array(‘shortcode’ =>array(‘Caption’,’insert code’,array(array(‘parameter1 name’,’parameter1 description’,’optional flag’,’valid values’,’value’),array(‘parameter2 name’,’parameter2 description’,’optional flag’,’valid values’,’value’)))

    I hope to find sometime this weekend to play around with this.

    Anyway thanks for this plugin, great work!

    Zafrir

  5. Keith says:

    I’ve never used jQuery. I prefer to write my own js rather than learn someone else’s huge framework.

    You ideas, however, about making it extensible and limiting the help screen are wonderful.

    I may find time this week to play with it.

    I have been thinking that there must be a way to hook the visual editor to add a plugin menu. This might be a better place for things.

    That being said, the plugin is very unpopular. It is one of those plugins that are difficult to describe. It has not been downloaded very often at all. I am surprised that you found it.

  6. Zafrir says:

    Ok,
    Regarding no-1, looking at the plugin code I see it does not show help on specific, do I suggest the following inprovement:
    remove the onmouse from the top level div (line 222),
    add div id named as the shortcode to each help div,
    remove the special shortcode renaming for your private shortcodes (line 259),
    add the following jQuery to element mouseover (line 260):
    jQuery(‘#gb0’).show();jQuery(‘#gb0 > div’).hide();jQuery(‘#gb0 > #$key’).show();

    this will show help for specific “hovered” item, the help remains open while in editor and only replaced when you hover other item in the list.
    saves space and display only focused help.

  7. Zafrir says:

    Great plugin thanks!!

    few comments:
    1. hovering over a shortcode on the meta box, displays all the shortcodes help boxes (not the specific one) -is it my problem or normal behavior?
    2. suggestion: since I have many plugins developed, I suggest to put the help file as external xml file, so we can add shortcodes help without the need to edit the plugin source file.

    thanks,
    regards
    Zafrir

Leave a Reply