0

I need to create a field for a specific node, but I really don't want to create a new content type, for various reasons...

Is there a module that does that?

Say I wanted to create my own module that does that, how do you recommend I approach this?

1

A field of the Field API is meant to be used in an entity. Nodes are specific types of entities, such as users are. Fields are attached to specific bundles of an entity. Content types for nodes are the bundles of the nodes entities. If an entity type does not support bundles, such as users, then fields are bound to the entity regardless. For more on the subject see Drupal.org: An introduction to Entities.

As such, a field is not designed to belong to a particular entity but rather to an entity type/bundle (briefly, not designed to belong, meaning that the database design and programming logic as is would not support something like that).

So to sum up, it would require some considerable coding effort to achieve something like this and it would be advised to reconsider your design to take into account those factors.

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.