I'm currently trying to call variables called {{entry.title}}
, {{entry.latitude}}
and so on in an array.
This is what it looks like:
{% set markerArray = [] %}
{% for entry in craft.entries.section('xSpots') %}
{% set tempMarkerArray = [
{'name':'{{entry.title}}','url':'{{entry.Url}}','lat':'{{entry.latitude}}','lng':'{{entry.longitude}}'}
] %}
{% set markerArray = markerArray|merge(tempMarkerArray) %}
{% endfor %}
When calling {{markerArray[0].name}}
afterwards I am expecting it to return the proper title of the entry in Craft, instead it only returns "{{entry.title}}", as if the variable is not properly recognized while filling the array.
Any help? Am I doing something fundamentally wrong? Thanks in advance.