Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

164
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda