Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post.

    This seems to to happen due to the way the World Currency plugin is embedding its JavaScript code (which then does the “magic” of fetching the correct currency value). In my opinion, this way is not very good, as this should be possible without JavaScript.
    Now, to embed its JavaScript, the plugin searches through the post and looks for [worldcurrency...] Shortcodes. Of course, when these are embedded into a table, none are found directly in the post content.
    Due to that, the JavaScript code is not embedded, and thus the functionality does not work of course…

    Unfortunately, there’s nothing I can change/do in WP-Table Reloaded about this. World Currency will need to change its way of detecting a currency…

    Regards,
    Tobias

    Thread Starter 00kennedyp

    (@00kennedyp)

    do you know any plugins that would work with your plugin???

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    you mean for currency conversion? No, sorry, I have never had a need for this, sorry…

    However: The best way might be to contact the author of World Currency and make him aware that his way of embedding the JavaScript code is not a good way. It really should only be minor changes to make this work.

    Regards,
    Tobias

    Hi,

    I’m the author or WorldCurrency plugin, in version 1.10 (which I’m committing in a few hours) I’ve added the possibility to add a “wc_force” = 1 custom field to posts or pages to force the loading of the javascript code in cases like this one.

    For now is surely a solution, but Tobias, cause I’m preatty new to wordpress development if you have any suggestion for a better method I’ll gladly welcome it.

    Thank you,
    Daniel

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi Daniel,

    thanks for your reply here! That extra parameter sounds good.

    A better solution (just ideas here) might be to move the detection for whether the JS has to be included: While evaluating the plugin’s Shortcode, simply enqueue the JS to the footer.
    And maybe, you don’t even need JS (and AJAX requests): Simply hook into “the_content” and do the search/replace of the currencies there. This would not require any JS then and make everything a lot faster.

    Regards,
    Tobias

    Hi Tobias,

    thank you for the suggestions, I use JS and AJAX request to keep the process light, because the script has to contact Yahoo!Finance and sometime is a slow process, and I also need AJAX to allow the user to change the conversion currency without reloading the page.
    Anyway I’ll surely look on how to enqueue the JS during the shortcode evaluation process :9

    Thank you again,
    Daniel

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi Daniel,

    ah, ok. Contacting another server and having the ability to change the currency conversion without reloading are a good reason to use AJAX of course 🙂

    Best wishes
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘[wp-table-reloaded] – World currency plugin’ is closed to new replies.