A
A
artuh_a2014-09-16 15:33:12
PHP
artuh_a, 2014-09-16 15:33:12

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

3 answer(s)
A
Alexey, 2014-09-18
@artuh_a

I didn't do this task yesterday for you, did I? :)

print drupal_render(drupal_get_form('basic_cart_cart_form'));

H
HaveFun, 2014-09-16
@HaveFun

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.

K
khorpyakov, 2014-09-17
@khorpyakov

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 question

Ask a Question

731 491 924 answers to any question