0

I am creating a custom content type named "Invoice". This content type is having attributes like Company Name (entity reference to company content type), Bill details, tax details and calculations. Can you please suggest how can I get elements/attributes like shown in an image in custom content type add new content form? enter image description here

1

field_collection module allows you to add a field (Bill details) that contains a collection of fields (Amount, Service Tax, VAT, etc.). Set it to accept multiple values and you get a list like the one shown in the photo.

| improve this answer | |
  • I tried field_collect. Its not generating the table. If you have any demo link, can you please share? – Manish Joshi Feb 24 '16 at 15:16
  • Yes, it's not straightforward. Make sure you have a look at the documentation. After the field collection field is created it's managed under from Home > Administration > Structure > Field collections. This is where fields are added to the field collections created in the Manage fields tab. – zendka Feb 28 '16 at 0:20
1

You will need to override the node form template for your invoice content type with a custom template in your theme. More info -> Theming Node Forms in Drupal 7 and here

In your template you'd build a layout for your fields and output form fields in place like this

<?php print drupal_render($form['fieldname']);?>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.