3

I'm trying to add more fields to my content types.
I have a content type called Cars, and another called Airplanes; I want they belong to a category called "Transportation".

If I want to get a list of all transportation content types, it will return Cars and Airplanes.

  • by the way I'm not doing it in views because in case I'm adding a new content-type (for instance, Boats) I want to configure that it belongs to "Transportation" from the content type itself instead of changing the view – Asaf Jan 6 '12 at 11:21
  • Why not use Taxonomy? – gilzero Jan 6 '12 at 11:50
  • could you be more specific? if you mean taxonomy per content type item, that's not what I'm looking for as I'm trying to add data to the content-type itself (imagine an extra field with the "name" "type" "description" fields) – Asaf Jan 6 '12 at 12:22
1

Use taxonomy but automatically assign the taxonomy. So anytime you create a car, it's automatically assigned to term "transportation." You can do this with the Taxonomy Defaults module.

Taxonomy Defaults allows you to assign default terms from any vocabulary to any node-type. The default terms will be pre-selected on the /node/add form, but can be edited.

If a vocabulary is marked as "Hidden" for a particular content type, then that vocabulary will not be shown on the /node/add form and the default terms will be assigned automatically and cannot be edited.

The module is a bit tricky to get at first, make sure you select "hidden" so that the user can't change the default taxonomy.

0

Take a look at the Bundle Inherit module.

The main target of the Bundle Inherit module is to allow users to inherit bundles of different entity types from any other bundles of the same entity type. Inheritance could be performed while creating new bundle of some entity type (for example new content type). There are two types (modes) of inherit available:

  • Soft: All field instances from existing (parent) bundle will be cloned and attached to the newly created bundle. As for the soft mode it is all.
  • Strict: All field instances from existing (parent) bundle will be cloned and attached to the newly created bundle. After that you will not be able to directly edit inherited field instances in the children bundles and they will be always kept synchronized.
0

I have a similar concept one of my sites that I built where we track different suppliers and customers, I used taxonomies to separate a node as a either a client or supplier simply with taxonomy. then in my view I used an exposed filter so my user could choose whether they wanted to see a list of customers or a list suppliers.

You can also set multiple taxonomies, cause sometimes a supplier can also be a customer...

Hope this helps you out.

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.