• Resolved blazer030

    (@blazer030)


    Hey Bernhard,

    at first great work!

    I have one question:

    for this JSON

    {
      "warning": [
        {
          "identifier": "V0FSTklOR19fbWRtLnZpel9fTE1TLUJSL3JfTE1TLUJSLzI2MjcxNF9MTVMtQlIvNjEuMA==",
          "routeRecommendation": [],
          "description": [
            "Beginn: 24.01.2022 07:36",
            "",
            "A2 Berliner Ring Richtung Magdeburg",
            "zwischen Dreieck Werder und Lehnin",
            "defekter LKW auf dem Beschleunigungsstreifen, bitte vorsichtig fahren"
          ],
          "title": "A2 | AD Werder (81) - AS Lehnin (80)",
              },

    i get with this template

    {title}<br>
    {description}

    only the answer for the title part not for the description

    A2 | AD Werder (81) – AS Lehnin (80)

    I would appreciate your help. Thanks!

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

    (@berkux)

    Hi,

    thank you.
    Try this:

    [jsoncontentimporter url=https://wptest.kux.de/extra/json/blazer030.json]
    {subloop-array:warning:-1}
    identifier: {warning.identifier}<br>
    title: {warning.title}<br>
    {subloop-array:warning.description:10}
    {0}-{1}-{2}<br>
    {/subloop-array:warning.description}
    {/subloop-array:warning}
    [/jsoncontentimporter]

    Bernhard

    Thread Starter blazer030

    (@blazer030)

    Hey Bernhard,

    Thanks a lot! This works very well!

    One little question, is there a possibility so send a “Sorry Feed is empty” when the JSON File is empty as well?

    Plugin Author berkux

    (@berkux)

    Hi blazer030,

    not yet with the free plugin. You’re right: This would be a nice additional feature showing something when the API-request failed or the API gives nothing.

    A good API should give something in any case. But not all APIs are that good…

    Bernhard

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Description Template’ is closed to new replies.