WordPress.org

Ready to get started?Download WordPress

Forums

Picasa and Google Plus Express
execute shortcode in tinymce? (5 posts)

  1. markusk
    Member
    Posted 1 year ago #

    as i've just been hunting for code for the tiles-thingy anyways i thought i'd look for a solution for the images not displaying in the wysiwyg-editor as well..

    i'm no real coder, so i can't tell if this really works or what effort it would be to implement, but jtlyk:
    http://stackoverflow.com/questions/13687604/wordpress-shortcode-preview-in-tinymce

    cheerz.

    http://wordpress.org/extend/plugins/picasa-express-x2/

  2. gjanes
    Member
    Plugin Author

    Posted 1 year ago #

    This is an interesting concept, and I could see the benefit. Although looking at the example code provided in that artcile, it appears to me that the shortcode isn't actually being processed by wordpress, but instead the JS plugin for tinymce is processessing it.

    Now, I already have some functionality in place to use an ajax request to process the shortcode and return it (for the option to return HTML instead of shortcode), so I could probably utilize that in a tinymce plugin of some kind.

    But again it may be a matter of how much time it would take to implement, and also if it would have the desired outcome. I would be afraid that if I parsed the shortcode for the tinymce view, that if you did an update it would actually replace the shortcode in the post with the HTML... I'm not certain I know exactly how this would work, or how the built-in [caption] processing for tinymce works, as mentioned in that article.

    Anyone else have any experience doing something like this?

  3. gjanes
    Member
    Plugin Author

    Posted 1 year ago #

    From the comments in that article you shared, it appears as though the "wpgallery" tinymce plugin performs such a task, and basically it appears to:

    1) before displaying the content in the visual editor, it calls a JS function that processes content to switch the [gallery ...] shortcode into the HTML img tags, etc.
    2) before saving the content on an "update", it calls a JS function that processes the editor content and returns the HTML back to the shortcode format.

    So the real problem with that is the time it would take to do step #2. I could use ajax to have wordpress handle #1 fairly easily I would think. But reversing #1 back to shortcodes for #2 would be the tricky part.

    It's actually a shame that there isn't a plugin for wordpress that does this already, since this type of operation would be generic for any and all wordpress shortcodes.

    Don't know that such a thing would be feasible for this plugin alone given the amount of time I allocate to development on it.

  4. markusk
    Member
    Posted 1 year ago #

    yes.. instantly been looking for a plugin doing this myself, but it indeed seems there isn't any..

    i would love to help out, but as mentioned - i can't code myself. i can read code and hack around a bit, but just can't write a single line from scratch..

    anyways, it's great you got it updated that far, let's hope someone able to might give it some more pimping at some point..

    thanks,
    markus.

  5. markusk
    Member
    Posted 1 year ago #

    actually i mainly miss the visual presentation for single images inserted via shortcode now - or rather less myself than people like my girlfriend doing the content for our swimming-team's homepage. didn't realize that using such thing like the above also would render whole galleries of course.. mh.

    i know i could still switch back to the html-injection, but i'd much prefer going the futureproof way using the shortcode.

    but well, maybe someone comes up with an idea one day.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.