Fix excerpts on blog posts

This commit is contained in:
Oliver Davies 2018-12-31 12:13:05 +00:00
parent 429c373db7
commit ff9f0a7b0b
124 changed files with 187 additions and 604 deletions

View file

@ -1,21 +1,16 @@
---
title: Programmatically Load an Entityform in Drupal 7
excerpt: How to programmatically load, render and embed an entityform in Drupal 7.
tags:
- drupal
- drupal-7
- drupal-planet
- entityform
meta:
description: How to programmatically load, render and embed an entityform in Drupal 7.
use: [posts]
---
{% block excerpt %}
I recently had my first experience using the [Entityform module](https://www.drupal.org/project/entityform) in a project. It was quite easy to configure with different form types, but then I needed to embed the form into an overlay. I was expecting to use the `drupal_get_form()` function and render it, but this didnt work.
Here are the steps that I took to be able to load, render and embed the form.
{% endblock %}
{% block content %}
## Loading the Form
The first thing that I needed to do to render the form was to load an empty instance of the entityform using `entityform_empty_load()`. In this example, `newsletter` is the name of my form type.
@ -48,4 +43,3 @@ I could then pass this result into my theme function to render it successfully w
* [The entityform module](https://www.drupal.org/project/entityform)
* [My issue and patch to add the type hint to the entityform_form_wrapper function](https://www.drupal.org/node/2639584)
{% endblock %}