How to embed and render an entityform I have an entityform called 'foia_generator' and I'm trying to embed it as a contact form on a page (the tutorial I used is for embedding entityforms in blocks) ... hence my problem...

function foiagen_form($form, &amp;$form_state) {
    module_load_include('inc', 'entityform', 'entityform.admin');
    $entity_form_name = 'foia_generator';
    $render_estimate_form =
    entityform_form_wrapper(entityform_empty_load($entity_form_name), 'submit', 'embedded');
    echo drupal_render($render_estimate_form); 
    return $form;
}


This displays the form but it's not 'inside' the normal bounds of the site (using bootstrap subtheme) i.e. it's not rendered properly - it appears before the regular divs like the navbar etc... and spans the entire width of my screen.

If I can't do it this way can I programattically embed the 'entityform' on my 'contact page' as an entityreference field, (rendered)?

Thanks
Seems like a odd piece of code you've got there, for instance this will render your form randomly in the page:

    echo drupal_render($render_estimate_form); 


Which is probably what you're noticing already, that example you're linking is for render that piece of code inside a template but for what you describe you're rendering it in a form inside a block, I'd try something like this instead (untested):

function foiagen_form($form, &amp;$form_state) {
    module_load_include('inc', 'entityform', 'entityform.admin');
    $entity_form_name = 'foia_generator';
    $render_estimate_form =
    entityform_form_wrapper(entityform_empty_load($entity_form_name), 'submit', 'embedded');
    $form['foiagen'] = $render_estimate_form;
    return $form;
}