4

I have a question regarding entering data into custom entities

I have a usage case I believe is better for Drupal Entities than Content Types and Nodes. I have installed Entity Construction Kit and used it to set up the structure for my entity.

What is not clear to me is how I go about getting data into my entity. I assume we could do a mass CSV import via Feeds. But what about making individual entries? I'm looking for a way to enter the data through the Drupal Administration forms (i.e. Add Content > Entity Name) but that does not appear to be the case.

Are there additional modules out there that would give me the ability to do this?

Thank you for your time and assistance.

-- Chris

1

I think everyone suffers the same bewilderment on first meeting ECK. Its workflow is bonkers.

You begin by creating an entity type and optionally renaming the default bundle (which otherwise will have the same name as your entity). I recommend giving the bundle a unique name to avoid confusion in this rabbit warren interface.

Then from the list of entities, click into that entity and then into the bundle. From here you can manage fields - and add your data from the 'entity list' tab. There, the link to add new instances of your entity type will be at the top of the interface - "+ add [name of your bundle]" and the list there will effectively serve as a rudimentary content list for that entity until you can whip something up in views.

If you want to cut through the labyrinth and use a simple link to add your data, it'll be structured like this:

admin/structure/entity-type/[your entity name]/[your bundle name]/add

  • Thank you Peter, for your response. I did find that actually. What I'm struggling with in my head is how I eventually give my users access to this form so they can enter content. It did kind of throw me after I found it under Structure. This concerns me since my users wouldn't have access to the Structure menu. You mentioned its possible to build an edit form through a view? How is that accomplished? I've never done that before. I've only built views to display content. Thanks again! – ccorbett Apr 27 '13 at 2:23
  • I think our wires are crossed! I was referring to the list of entity content under the entity list tab - it's eck's equivalent of admin/content and that you would probably want to make a custom display for it using Views and VBO. For a custom form I assume you'd need to use the form API. – Peter Clemence Apr 27 '13 at 6:14
  • Exactly, yes. But is the Entity List tab not only accessible through the Structure Tab? – ccorbett Apr 27 '13 at 12:45
  • 1
    Yes. Have a look at this I stumbled on earlier. [trellon.com/content/blog/creating-own-entities-entity-api] It seems to cover much of what your looking for. – Peter Clemence Apr 28 '13 at 4:54
0

Answering your original question I would like to propose Model Entity module for your consideration. It is less known than ECK, but in a few projects it gave enough support for my goals.

Out of the box you will have entity editing forms not under Structure but for a bit more appropriate place - Content, so URL will look as /admin/content/models/add .

Hope this helps!

0

I use Inline Entity Form on my Drupal site. Although it is not entirely clear from the linked page, this module has options that allow you to create new entities (of a specified type & bundle), and then remove them from the form, but leave them in the database, you may then select to add the entities for display in other forms. You can enable and disable entity creation on each instance of a form.

The rest of my setup includes:-

  1. several custom entity types made with ECK, add fields using the usual UI.
  2. On a node[*] add an entity reference field for your custom entity, you should have two new choices for the widget - either a single entity form, or a multi-entity form.
  3. The entity creation form is now shown as part of the node creation page - and so will be accessible to those who have the usual permissions.
  4. Be sure to review the permissions for creation of the appropriate entity as well, otherwise the form will not function.

[*]this does not have to be a node, I also use this setup on my User account page.

0

I'm new to Drupal, but had the same question. After poking around, it seems that the https://www.drupal.org/project/entityform module is useful for entering data into custom entity data fields in Drupal 7. In 8 this will be Eform.

I've installed Entityforms and it seems to work. I have not had enough time to run into problems yet, though. Good luck.

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.