Fielded Content Types in Drupal

Posted on

in

,

Content types are like a custom type of page that also be used to sort other pages. In this example we’re making a destination content type and then allowing another page to select what destination that page belongs to.

To make a content type, go to ‘Structure/Content Types’ and then the ‘Add content type’ button. Give it the name of ‘Destination’ and then save it.

Make some destinations by going to ‘Content/Add content’, selecting Destination and giving the title any country that you like.

To make a destination selectable in say an article, go to ‘Structure/Content Types’ and click on ‘manage fields’ next to ‘article’.¬†Under ‘Add new field’, put the label ‘destination’ in the text field, and in the ‘select a field type’ dropdown, choose ‘Entity Reference. Also choose ‘Select list’ next to it. Save and then click ‘edit’ next to the new field. Scroll down to ‘Target bundles’ and tick ‘Destination’ and save.

Now when you go to ‘Content/Add content’ to make an article you’ll now see a ‘Destination’ field with a drop down to choose which destination this article belongs to.

Leave a Reply

Your email address will not be published. Required fields are marked *

About me

Mark Wong is a front end developer with 10+ years experience. Most of his knowledge of HTML5, CSS and Js is self taught.

Calendar

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930