• Resolved kh0309

    (@kh0309)


    Hello,

    I am working with the importer to try to get National Weather Service data to populate on a page. The API link I am using is https://api.weather.gov/gridpoints/FFC/25,76/forecast.

    Under "properties" I’m trying to select each of the individual objects in the "periods" array by themselves where I can put each period object in its own block, but I’m just not sure how to do it. My basenode is set to "properties" I know I can use {subloop-array:periods:-1}{number}{/subloop-array:periods} to get all the numbers 1-14, but let’s say I just wanted to get period number 3 (which would be index 2 in the array) by itself. Is there a way I can do that?

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Author berkux

    (@berkux)

    Hi,

    check this: This gives you number 2…

    [jsoncontentimporter url=https://api.weather.gov/gridpoints/FFC/25,76/forecast oneofthesewordsmustbein="a2b" oneofthesewordsmustbeindepth=2 basenode=properties.periods]<hr>
    <div style="display:none">a{number}b</div>{name}
    <hr>[/jsoncontentimporter]

    Bernhard

Viewing 1 replies (of 1 total)
  • The topic ‘Get One Specific Object Within An Array’ is closed to new replies.