Jump to content

twig: pass include to div for popup


4xjbh

Recommended Posts

I have a div I use for dialogs and I want to pass a string to the div and then show the specific twig template as an include. The div dialog is displayed without the template embedded, What am I doing wrong, is there a better way to do it?

$('#new').click( function() {
   var str = " {% include 'catalogue_form.html' %} ";
   $('#dialog').text(str).html();
  showDialog();
});


function showDialog() {             
   $('#dialog_wrapper').fadeIn();
   $('#dialog').fadeIn("slow");                     
} 

Thanks in advance, James

Link to comment
https://forums.phpfreaks.com/topic/280661-twig-pass-include-to-div-for-popup/
Share on other sites

Yes I could but single.html (master layout) would not be able to be used for say contacts because I would need to include contacts_form.html

 

If I have single.html and contact.html that extends single.html how do I assign note.html, review.html, expense.html (dialog templates) to the one div if I cannot dynamically assign it based on the selected action. Do I have to have 3 divs with display:none, and individual includes?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.