Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
How to pass Javascript variable into expression engine tag?

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?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!