Okay
  Public Ticket #1887439
shortcode parameter
Closed

Comments

  • Maxim started the conversation

    I have table with countries statistics
    parameter_name, country_1, country_2, ... country_25
    parameter_1,,,,,
    parameter_2,,,,,
    parameter_3,,,,,

    And need to create individual Country profile Pages
    May I use on each page the same table with some shortcode parameter to pre filter table data
    like [table-1 prefilter_column1=USA] [chart-1 prefilter_column1=USA]

    This case I can show on individual USA page data related with USA only, but use common table source, chart design.

    also I can call table and chart in php with do_shortcode or some other way if there is such option 

    Is there any parameters in shortcodes in your plugin

  •  471
    Isidora replied

    Hi Maxim,

    Thank you for your interest in wpdatatables.

    You can take a look in our documentation about Making dynamic SQL Queries with placeholders.

    So you will see that you can pass placeholder in query and create table and then pass different placeholders values in shortcode on each page so you will get different data on each page.

    About the chart, when you create this table from above you will make chart that you need for it and then turn on option Follow table filtering in charts which means that chart will be filtered based on data in table(on each page different because of different value for placeholders)

    You can take a look in our documentation about Actions and Filters which are defined in wpDataTables plugin for customization's by developers.(if you need some custom solutions)

    You can try this on our sandbox site: Front-end & Back-end - you can find a fully functional version there to try out all plugin features.

    Best regards.


    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  • Maxim replied

    sorry for delay. I have understand about placeholders, but as I see https://tmsplugins.ticksy.com/ticket/1543638/
    It can't help with dynamic charts any way.

    Plugin can display pre-filtered table according %VAR%, but can't draw charts.
    Chart requires pre-made shortcodes, If need to create page for each country with some stats, this stats can be displayed as a table only, never as charts.

  •  471
    Isidora replied

    Hi Maxim,

    I will try to explain again. Yes it is not possible to use placeholders in charts shortcodes, but when you insert placeholders in table shortcode and from that table you made chart where you will enable option  Follow table filtering in charts chart will be updated with data in table that is filtered with that placeholder.

    All of this you can try in our sandbox Front-end & Back-end.

    Plugin can display pre-filtered table according %VAR%, but can't draw charts.

    Like I explain it is possible to use prefiltered table data (with placehodlers) in charts.

    Chart requires pre-made shortcodes, If need to create page for each country with some stats, this stats can be displayed as a table only, never as charts.

    Sorry but I did not quite understand what are you trying to achieve. Can you please explain me in little more details and send me some example/screenshot/screencast, so I can give you my suggestion.

    Best regards

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  • Maxim replied

    Thanks a lot for the explanation. It's clear now.

    1. It's possible to use one big table as source for graph.

    1.1. Use %VAR1% for selecting data for the object needed (country in my case)

    Rem.: Lot of graphs can be linked to the main table and displayed on same page

    2. Create templates for charts Need to be implemented on page

    3. Set follow table filtering in charts

    4. If you don't need table, but only graph on page, than easy trick can be used:

    on table properties Display - hide all columns, table name, tools...

    This case table still exist on page but "disappears" for front end user because nothing to display :)


    Your solution is great.Means I can use it.

    Only one moment needs to check/test is how to assign required variable to the %VAR1%

    <?php $region_code = get_field( "country_code" ); ?>
    <?php echo do_shortcode( '[wpdatatable id=4 var1=$region_code]' ); ?>



  •  471
    Isidora replied

    Hi Maxim,

    You are welcome.

    Yes only this what you need to hide is pagination (if you have a lot of data) You can take a look in our Support Help Center to find how you can hide it with CSS and also a lot of useful information.

    How you will pass variable to the placeholders in our shortcode depends on of your logic and template that you are using. 

    Best regards.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables