I have two Instagram API responses that I want to merge, by the photo's created_time
. Is there a way to do that in Twig?
Right now I am just using this
{% set instagram = <data> %}
{% set community = <data> %}
{% set feed = instagram|merge(community) %}
{% for photo in feed %}
<img src="{{photo.images.low_resolution.url}}" alt="">
<br />
{% endfor %}
Each photo has a created_time string that I'd like to sort the array by, is that possible without creating a custom Twig extension?
The sortByField plugin looked promising and sort of what I want, but it was directly aimed at Craft entry manipulation. Is there anything hacky that could be done?