Okay
  Public Ticket #3391217
wptable xml
Closed

Comments

  • David started the conversation

    Hello

    this is my xml version

    {     "content": [         {             "viewGameReport": true,             "id": 3070,             "date": "2022-08-06 18:30",             "time": "1970-01-01 01:00",             "cancelled": false,             "status": 0,             "goalsHomeTeam": 0,             "goalsAwayTeam": 2,             "homeClub": {                 "id": 298,                 "name": "K Zwaluwen Olmen",                 "abbreviation": "K Zwaluwen Olmen",                 "version": 2             },             "awayClub": {                 "id": 389,                 "name": "K Berg En Dal Vv",                 "abbreviation": "K Berg En Dal VV",                 "version": 1             },             "competitionType": "Beker",             "homeTeamId": 1,             "awayTeamId": null         },

    see like json version

    https://www.kvvzwaluwen.be/voetbal/wedstrijden-team-1-response.json

    result

    https://www.kvvzwaluwen.be/wedstrijden-team-1ste-Ploeg-2-Prov-B

    with wptable i'm able to connect to api from external website where i get data.

    now the data from root-content-homeclub is showing

    https://wp.kvvzwaluwen.be/test/

    when i do the same xml connection but select 

    root-content i get this result

    https://wp.kvvzwaluwen.be/test2/

    i need combination of test2 - test

    i'm planning to buy software

    kr

    david

  •  1,698
    Miloš replied

    Hi, David.

    If i understood, basically you need to combine data such as a Nested JSON, but you need to show two roots?

    Please check out our detailed Documentation here that explains what kind of format you need to make Nested JSON with our plugin,

    and also in regards to roots, we pointed this out :

    The plugin allows you to choose what the “roots” for creating the table will be, 

    but please note that you can only select one level within your JSON file to create a table.

    -

    Another important note:
    The root path that is chosen, needs to have the same object with the same keys and values as you can see for chosen path “root->results”. 

    If values are not a string, then those values will be skipped by default. 

    In this case from our Documentation,  keys “films”, “vehicles”, “starships”, and “species” have values as arrays (in some cases they can be objects) and they will not be shown.

     If you need to show data from those arrays as well, there is an option with a hook, which our developers have shown in the Documentation Page, just scroll to the section named :

    "Use hooks to parse one more level deep in root path".

    1426257142.png

    Let us know if that helps.

    -

    And i just wanted to point out that you can try wpDataTables before purchasing

     on our sandbox Demo sites ( you can find links for the main plugin Demo,  

    as well as add-on Demos, in my signature),

    and there is a 15-day money-back guarantee period, 

    so if you purchase the plugin, you can safely fully test it out, and if it doesn't fit your needs you can request and receive a refund in that period. ( same goes for all plugins and add-ons)

    Let me know if you have any additional questions. smile.png

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

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

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • David replied

    thank you for the reply

    now i understand what you explained but i don't find where i need to add the hook. is this in the table or somewhre else

    i need to create 3 tables / soccerteam

  • David replied

    hello

    i need help on achiving this


    Use hooks to parse one more level deep in root path

    If one of chosen root path objects contains keys that have an array or objects as values and you need to include them in a table as cell values, then you can choose these two hooks:

    • wpdatatables_get_one_level_deep_json_data_from_array_as_string and
    • wpdatatables_set_one_level_deep_json_data_separator

    For the first hook that accepts 3 params

    • $deepParse – boolean – false by default,
    • $jsonURL – string – nested JSON URL ,
    • $tableID – int – id of the table


  •  2,499
    Aleksandar replied

    Hello David.

    We're sorry to disappoint you, but we do not provide support for hooks and filters.

    It requires a certain level of programming skills and included support refers only to advice.

    The hooks are to be added to functions.php file of the theme or the child theme. The code is similar to the one found on our documentation. The important thing is that the last argument (that informs you about the number of parameters) is 3, since in our code, 3 parameters are forwarded. You do need some programming knowledge for this. If you want to see in wpDataTables code where they are being used, it's in ../wp-content/plugins/wpdatatables/source/class.wdtnestedjson.php file, on line 276, where these filters are being called.

    You don't need to change anything in the code, though, just add the code to functions.php and call the hook with that name (wpdatatables_get_one_level_deep_json_data_from_array_as_string).

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

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

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables