subloop with wildcard basenode_subloop
-
Hi
I’m using your free version to get live bus times from: https://www.transportapi.com
I’m using the
/uk/bus/stop/{atcocode}/live.json
endpoint to get live bus times for a given bus stop:
https://developer.transportapi.com/docs?raml=https://transportapi.com/v3/raml/transportapi.raml##uk_bus_stop_atcocode_live_jsonUsing JSON Content Importer, I want to loop over the objects in the “departures” basenode, but am required to put in the name, e.g. “17” or “89” or “16|gold”, here is a sample of my specific API call (keys removed):
https://jsonblob.com/14ac9f7d-3b49-11ea-87b1-d9d728308089Here is my WP shortcode:
[jsoncontentimporter url="https://transportapi.com/v3/uk/bus/stop/2400A045190A/live.json?app_id=XXX&app_key=XXX" basenode="departures"] <table> <tr><th>Bus No.</th><th>Scheduled time</th><th>Expected time</th></tr> {subloop-array:17:-1} <tr><td>{line_name}</td><td>{aimed_departure_time}</td><td>{expected_departure_time}</td></tr> {/subloop-array} </table> [/jsoncontentimporter]
Is it currently possible to loop over these items without specifying the ‘inner’ basename?
- The topic ‘subloop with wildcard basenode_subloop’ is closed to new replies.