• Resolved aquarium12345

    (@aquarium12345)


    Hello!

    I′m having difficulties using Tablepress and WordPress Short Code Plugins.
    The goal is, to accieve

    I′m using Stock-Market Plugin :
    [stock_ticker symbols="MMM" show="false" static="true"]

    This gives me live data of a stock like “150,50” in cell B2.

    Now i want to have multiplication of B2 in B3 like:
    B3= B2*2

    This doesnt work, and gives the error: !ERROR! B2 does not contain a number or expression

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    For this, you will need to instruct TablePress to first evaluate Shortcodes, and only then the formulas. This can be done with the TablePress Shortcodes before Formulas Extension, from https://tablepress.org/extensions/shortcodes-before-formulas/
    After installing and activating it, modify the Shortcode that you use with an extra parameter:

    [table id=1 shortcodes_before_formulas=true /]
    

    In addition, you will need to make sure that your stock_ticker Shortcode returns a pure number, in US format. That means that it must return a number with the . as the decimal separator, e.g. 150.50 (but not 150,50). For later converting back to the comma, you can use the NUMBER_FORMAT() function, see https://tablepress.org/tablepress-features-formulas/

    Regards,
    Tobias

    Thread Starter aquarium12345

    (@aquarium12345)

    Hello and thanks for your answer!

    I just implemented all the things you said but i still do not get the success i want to.
    After installing and activting the plugin, somehow the stock_ticker shortcode does not work anymore. In my table it returns the following:

    class=”stock-ticker-wrapper ”
    data-stockticker_symbols=”MMM”
    data-stockticker_show=”false”
    data-stockticker_number_format=”cd”
    data-stockticker_decimals=”2″
    data-stockticker_static=”true”
    data-stockticker_class=””
    data-stockticker_speed=”50″
    data-stockticker_empty=”true”
    data-stockticker_duplicate=”false”
    >
    Loading stock data…

    Do you have any idea why this is the case? Thanks in advance!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    from this, it looks like that the stock ticker is actually loading the data via JavaScript, and not by simply printing the resulting number into the HTML.
    For that, it likely needs a JS file, which will only be loaded if the table output caching is turned off. To achieve that, please extend the Shortcode on the page with another parameter, like

    [table id=123 cache_table_output=false /]
    

    Now, this does however mean that these results can not be used in formulas, as the numbers are not available on the server side (unless this can be changed in the stock ticker plugin).

    Regards,
    Tobias

    Thread Starter aquarium12345

    (@aquarium12345)

    Hi,

    thanks! Unfortunately the paramenter [table id=2 cache_table_output=false / shortcodes_before_formulas=true / ] doesn not accieve the goal. The output still looks like this:

    class="stock-ticker-wrapper "
    data-stockticker_symbols="MMM"
    data-stockticker_show="false"
    data-stockticker_number_format="cd"
    data-stockticker_decimals="2"
    data-stockticker_static="true"
    data-stockticker_class=""
    data-stockticker_speed="50"
    data-stockticker_empty="true"
    data-stockticker_duplicate="false"
    >
    Loading stock data...

    However, if the output cant be used in formulas i think this will not work ??

    Regards

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    please use

    [table id=2 cache_table_output=false shortcodes_before_formulas=true /]
    

    Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    Regards,
    Tobias

    Thread Starter aquarium12345

    (@aquarium12345)

    Hi,

    im sorry, this site is hosted in a lab environment on localhost, so there is no way to access from an external source.

    I already use [table id=2 cache_table_output=false shortcodes_before_formulas=true /] but the problem remains the same.

    Thanks!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    that’s strange. You might want to check for any JavaScript errors in the browser’s error log console then.

    Regards,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘multilicate data from short codes’ is closed to new replies.