I'm working with EE v2.9.3, I want to make js variable with json structure. I want to dynamically pass the parent id into the expression engine tag but it didn't work. It works between {exp} tag but it didn't as the tag parameter. Here's the code
<script type="text/javascript">
var d = [
{exp:structure:entries channel="channel-city" disable="categories|category_fields|member_data|pagination" dynamic="no" status="open"}
{
"name": "{title}",
"locations": getLocals({entry_id})
},
{/exp:structure:entries}
];
function getLocals(id) {
return [
{exp:structure:entries channel="restauracje-lokal" disable="categories|pagination" parent_id="id" //not working here}
{
"name": "{title}",
"phone": "{phone}",
"email": id, //working here, test purposes only
},
{/exp:structure:entries}
]
};
console.log(d);
</script>
So my queston is how can I pass my variable inside {exp} tag?