Support » Plugin: JSON Content Importer » Help needed / New to JSON Importer

  • Resolved djulian75

    (@djulian75)


    Hello

    I try to extact content from : https://www.communecter.org/api/organization/get/id/5704179a40bb4ef30416c9ab

    I get access to data on the top and in the first subloop but can’t find access to the second subloop

    [jsoncontentimporter url=https://www.communecter.org/api/organization/get/id/5704179a40bb4ef30416c9ab]
    {@type}
    {name}
    {typeCommunecter}
    {subloop:url:-1}
    {url.api}
    {subloop:url.address:-1}
    {url.address.streetAddress}
    {url.address.postalCode}
    {url.address.codeInsee}
    {/subloop:url.address}
    {/subloop:url}
    [/jsoncontentimporter]

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

    (@berkux)

    Hi Julian,

    url and address are separate objacts in the JSON. Or: adress is not nested in url but on its own.
    Try:
    [jsoncontentimporter url=https://www.communecter.org/api/organization/get/id/5704179a40bb4ef30416c9ab]
    type: {@type}
    name: {name}
    typeCommunecter: {typeCommunecter}
    {subloop:url:-1}
    subloop url.api {url.api}
    {/subloop:url}
    {subloop:address:-1}
    subloop address {address.streetAddress}
    {address.postalCode}
    {address.codeInsee}
    {/subloop:address}
    [/jsoncontentimporter]

    Bernhard

    Thank you for your answer !

    Another question

    In :
    https://www.communecter.org/api/organization/get

    The name of each field is the id of the entity ; I don’t know the method to access the datas in the “entities” field

    Plugin Author berkux

    (@berkux)

    This can’t be done by the free version, this is done by this with the pro-version:
    https://json-content-importer.com/download/

    [jsoncontentimporterpro url=https://www.communecter.org/api/organization/get parser=twig]
    {% for key, val in entities %}
    {{key}}: {{val.name}}<br>
    {% endfor %}
    [/jsoncontentimporterpro]

    Bernhard

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.