• Resolved lzevon

    (@lzevon)


    I have the following code in my sandbox site:
    `[jsoncontentimporter url=”https://trans-ocean.com/wp-content/themes/transocean/json/Health_Plan_Transparency_Compliance.json” debugmode=”10″]
    Reporting Entity Name: {reporting_entity_name}
    Reporting Entity Type: {reporting_entity_type}

    Plan Name: {reporting_structure.reporting_plans.plan_name}
    Plan ID Type: {reporting_structure.reporting_plans.plan_id_type}
    Plan ID: {reporting_structure.reporting_plans.plan_id}
    Plan Markey Type: {reporting_structure.reporting_plans.plan_market_type}

    {subloop-array:reporting_structure:in_network_files:-1}
    Description: {reporting_structure.in_network_files.description}
    Location: {reporting_structure.in_network_files.location:html}</hr>
    {/subloop-array:reporting_structure.in_network_files}[/jsoncontentimporter]’

    I can return the entity type and entity name and generally see in the debug that the file is being read. I can not seem to figure out despite many iterations, how to pull in the remaining one-time data (plan name, type, id and market type) and subloop data (description and location).

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author berkux

    (@berkux)

    Hi,

    try this:

    [jsoncontentimporter url=https://trans-ocean.com/wp-content/themes/transocean/json/Health_Plan_Transparency_Compliance.json]
    Reporting Entity Name: {reporting_entity_name}
    Reporting Entity Type: {reporting_entity_type}<hr>
    
    {subloop-array:reporting_structure:-1}
    
    {subloop-array:reporting_structure.reporting_plans:5}plan_name: {reporting_structure.reporting_plans.plan_name}<br>
    {/subloop-array:reporting_structure.reporting_plans}
    
    {subloop:reporting_structure.allowed_amount_file:-1}
    allowed_amount_file.description <a href="{reporting_structure.allowed_amount_file.location}" target="_blank" rel="noopener">{reporting_structure.allowed_amount_file.description}</a><br>
    {/subloop:reporting_structure.allowed_amount_file}
    <hr>
    
    {subloop-array:reporting_structure.in_network_files:-1}
    in_network_files.description <a href="{reporting_structure.reporting_plans.location}" target="_blank" rel="noopener">{reporting_structure.in_network_files.description}</a><br>
    {/subloop-array:reporting_structure.in_network_files}
    
    {/subloop-array:reporting_structure}
    [/jsoncontentimporter]

    Bernhard

    Thread Starter lzevon

    (@lzevon)

    Closer! I can see the links aren’t working, but can investigate that tomorrow when I have a block of time. Thank you!

    Thread Starter lzevon

    (@lzevon)

    I’ve cleaned it up somewhat, but am still trying to figure out how to get the links to work (they all link to the parent page at present). I’ve tried modifying the subloop ~10 different ways without success, so I may not be looking in the right place. Each location should have a link to a .gz as you can see from the JSON source?

    Plugin Author berkux

    (@berkux)

    Hi,

    try

    [jsoncontentimporter url=https://trans-ocean.com/wp-content/themes/transocean/json/Health_Plan_Transparency_Compliance.json]
    Reporting Entity Name: {reporting_entity_name}
    Reporting Entity Type: {reporting_entity_type}<hr>
    
    {subloop-array:reporting_structure:-1}
    
    {subloop-array:reporting_structure.reporting_plans:5}reporting_structure.reporting_plans.plan_name: {reporting_structure.reporting_plans.plan_name}<br>
    {/subloop-array:reporting_structure.reporting_plans}
    
    {subloop:reporting_structure.allowed_amount_file:-1}
    allowed_amount_file.description <a href="{reporting_structure.allowed_amount_file.location}" target="_blank" rel="noopener">{reporting_structure.allowed_amount_file.description}: {reporting_structure.allowed_amount_file.location}</a><br>
    {/subloop:reporting_structure.allowed_amount_file}
    <hr>
    
    {subloop-array:reporting_structure.in_network_files:-1}
    in_network_files.description <a href="{reporting_structure.in_network_files.location}" target="_blank" rel="noopener">{reporting_structure.in_network_files.description}: {reporting_structure.in_network_files.location}</a><br>
    {/subloop-array:reporting_structure.in_network_files}
    
    {/subloop-array:reporting_structure}
    [/jsoncontentimporter]

    This should give you something like
    https://wptest.kux.de/trans-ocean-com/

    Bernhard

    Thread Starter lzevon

    (@lzevon)

    Thank you! I got it with a little fiddling…

    [jsoncontentimporter url=https://trans-ocean.com/wp-content/themes/transocean/json/Health_Plan_Transparency_Compliance.json]
    Reporting Entity Name: {reporting_entity_name}
    Reporting Entity Type: {reporting_entity_type}<hr>
    {subloop-array:reporting_structure:-1}
    {subloop-array:reporting_structure.reporting_plans:5}Plan Name: {reporting_structure.reporting_plans.plan_name}<br>
    {/subloop-array:reporting_structure.reporting_plans} {subloop:reporting_structure.allowed_amount_file:-1}
    Plan Description: <a href="{reporting_structure.allowed_amount_file.location}" target="_blank" rel="noopener">{reporting_structure.allowed_amount_file.description}</a><br>
    {/subloop:reporting_structure.allowed_amount_file}
    <hr>
    {subloop-array:reporting_structure.in_network_files:-1}
    <a href="{reporting_structure.in_network_files.location}" target="_blank" rel="noopener">{reporting_structure.in_network_files.description}</a><br>
    {/subloop-array:reporting_structure.in_network_files}
    {/subloop-array:reporting_structure}
    [/jsoncontentimporter]
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Partial success with data’ is closed to new replies.