Closed (outdated)
Project:
Inline Entity Form
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Jul 2012 at 16:22 UTC
Updated:
17 Feb 2024 at 04:26 UTC
Jump to comment: Most recent
Comments
Comment #1
bojanz commentedFor that you should use hook_inline_entity_form_entity_form_alter().
See inline_entity_form.api.php for an example.
Comment #2
big_smile commentedHi Thank you so much bojanz! That worked. I have put a mini tutorial at the bottom of this post to help other people.
However, I would really like to assign a template tpl.php file to the embedded entity (Just like you would if you wanted to theme a regular node/add form). How can I do this?
Mini Tutorial - How to theme entity forms
Paste the following into template.php
Make the follow changes
YOURTHEMENAME - Replace this with the theme of your name
TYPE - Replace this with entity you are referencing. If you are referencing a node, put the words "node" in (i.e. you would NOT put the name of the content type).
YOUR_CUSTOM_FIELD - Put the name of the field you wish to alter
VALUE - Put in the value you wish to change. Common example values include:
['YOUR_CUSTOM_FIELD']['#prefix'] = "
['YOUR_CUSTOM_FIELD']['#suffix'] = "
";
['YOUR_CUSTOM_FIELD']['#markup'] = t('Please tell us your message.');
['YOUR_CUSTOM_FIELD']['#weight'] = -1;
Don't forget to clear the caches after you have finished to make the changes appear (You can to do this at yoursite.com/admin/config/development/performance).
Comment #3
big_smile commentedComment #4
Spider84 commentedHello.
I have the same problem. I need to assign Template to inline form. Is it possible? How can I do It?
Comment #5
dgastudio commentedany update?
Comment #6
pbz1912 commentedComment #7
thibaut51 commentedUpdate about #2 answer.
After searching for a while why it didn't work when I modify my template.php, it try do do the same within a custom module. It's works just fine.
Make the follow changes
YOURMODULE - Replace this with the name of your module
TYPE - Replace this with entity you are referencing. If you are referencing a node, put the words "node" in (i.e. you would NOT put the name of the content type).
YOUR_CUSTOM_FIELD - Put the name of the field you wish to alter
VALUE - Put in the value you wish to change. Common example values include:
['YOUR_CUSTOM_FIELD']['#prefix'] = "";
['YOUR_CUSTOM_FIELD']['#suffix'] = "";
['YOUR_CUSTOM_FIELD']['#markup'] = t('Please tell us your message.');
['YOUR_CUSTOM_FIELD']['#weight'] = -1;
Don't forget to clear the caches after you have finished to make the changes appear (You can to do this at yoursite.com/admin/config/development/performance).
Comment #8
mglamanNo patch, nothing to review.
Comment #9
gettysburger commentedAny answer for #4 about how to apply a template? Thanks.
Comment #10
achikas commentedfor me i found an easy way to theme the form fields thru an IEF with Display Suite and Field Groups. In DS i enabled form layouts and then i put my fields in some field groups, to style theme via css.
Comment #11
dcam commentedI'm closing old IEF support issues. Please feel free to re-open the issue if you still require assistance.