Adding a form to a page

Normally forms can be created with the Web Cube Forms. There are situations where we need to add/embed forms in other web site areas managed by other Web Cube applications (i.e. FAQs, Pages, Press etc.). This tutorial will show you the steps required to add/embed a form.

 

1. Create a form using the Forms application.

2. Open the template used by that specific Web Cube app. For example if we need to embed a from in the FAQs application then open the faq/index.html template. 

3. Add the following line to the top of the template.

{% load form_tags %} 

Note: If your template contains an "extends" template tag such as  {% extends "webcube/base.html" %} please make sure the {% load form_tags %} is placed below the "extends" tag.  

 

4. Then to place the form in the template add the following:

<form action="/forms/my-form-slug/" method="post">
{% embed_form request "my-form-slug" %}
</form>
Replace my-form-slug with the slug for the from to be embedded. 

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk