Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda