Answer the question
In order to leave comments, you need to log in
Drupal: Is it possible to specify a link to activate a modal in a template (eg page.tpl.php)?
Welcome all.
I may be doing something wrong, please do not kick much.
I wanted to use the modal window call in the page.tpl.php template:
There is a Modal forms module (with ctools)
In one of the articles (node) I added a link to call the modal window with the form:
<p><a class="ctools-use-modal ctools-modal-modal-popup-medium" href="modal_forms/nojs/webform/43">Обратная связь</a></p>
<p><a class="ctools-use-modal ctools-modal-modal-popup-medium" href="modal_forms/nojs/webform/43">Обратная связь</a></p>
Answer the question
In order to leave comments, you need to log in
You have provided a link href="modal_forms/nojs/webform/43"
If you are currently on the page my_say.com/page_url and click on the link, it will go to my_say.com/page_url/+modal_forms/nojs/webform/43 and will not find anything, because such an address does not exist. If you specify href="/modal_forms/nojs/webform/43"
a forward slash, then the url will always be generated like this my_site.com +/modal_forms/nojs/webform/43. you need to specify the correct url in the nref of the link.
Kinda like that. I hope you understand what I wrote here :)
Firstly, as Alex said, a link with a slash
Secondly, you need to load the necessary js nicknames
For example, through php code
ctools_include('ajax');
ctools_include('modal');
ctools_modal_add_js();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question