Answer the question
In order to leave comments, you need to log in
How to programmatically display a form from a module in Drupal7?
Hello!
It costs the basic_cart_ajax module. I want to display the web form of his cart on all pages of the site. It is registered in basic_cart_ajax\theme\basic_cart_ajax_cart_form.tpl.php and is available only on the /cart page. Does anyone know how to programmatically do this in a page template?
Answer the question
In order to leave comments, you need to log in
I didn't do this task yesterday for you, did I? :)
print drupal_render(drupal_get_form('basic_cart_cart_form'));
If the module is an extension of this module , then it is enough to activate it on the block management page and add it to the desired region.
It is better to do it not in a template, but in a preprocessor. Use the drupal_get_form() and drupal_render() functions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question