To load an Entityform into a block, there are three ways of accomplishing this:
There is a module for that
Allows to load a specified entity form as a block.
After enabling the module, the entityforms will have an optional checkbox to make them a block.
Leveraging Entity API and Views
It is possible to quite easily do this using views. I got this from https://drupal.org/node/1599352#comment-7040050 , thanks @drupov
- Create a new view
- On the "Add new view" page choose "Show: Entityform Type"
- Check "Create a block" and under "Display format" choose "Fields" (not "Rendered Entity")
- In your view settings be sure to add the field "Entityform Type: Rendered Entityform Type"
- The important settings for the field are "Display: Show Complete Entity" and in the appearing dropdown select "Full content"
- You should also add a filter "Entityform Type: Internal, numeric entityform type ID" and give it the value/ID of the form or what I find more elegant is the filter "Entityform Type: Machine-readable name" and give it the machine name of the entity form.
This isn't tested om multi-page forms.
BEWARE: In the entityform module settings you can setup which roles should be able to submit the forms. When you create a block in this way these settings are being overriden by views and even if you dissallow the anonymous user to submit the form in the module settings, having the view being visible by "View published content" would make the form appear.
So you have to apply the same access settings to your view.
Hardcoded into module/template
If you have a template/module that will output to a template you will can use a code similar to this:
module_load_include('inc', 'entityform', 'entityform.admin'); $entity_form_name = ''; $render_estimate_form = entityform_form_wrapper(entityform_empty_load($entity_form_name), 'submit', 'embedded'); echo drupal_render($render_estimate_form);
This code will need to be adjusted for each use case. Make sure to declare the $entity_form_name variable.