Creating Custom Content Types
CREATING CUSTOM CONTENT TYPES
When you create content on your website, each item of content is categorized by a specific content type. The websites we provide are Drupal based and come with several standard content types (page, bookpage, event, etc.), with each content type containing the information and settings that make it suited for a specific purpose. At times, you may want to create entirely new content types for purposes specific to your store needs.
For the example below we are creating a custom content type for ‘Articles’ which will include headline, date, body and image fields.
CREATE THE CUSTOM CONTENT TYPE
Navigate to Structure > Content Types > Add Content Type
- Enter the name of your new content type - Example: Articles
- Enter a description - Example: All news articles for the store
- Set the ‘Submission Form Settings’ - Give your title field a label (by default it will be ‘Title’) - Example: Headline
- Set your ‘Publishing Options’ to your preference
- Set ‘Display Settings’ - Example - as we plan to add our own date field, toggle off the ‘DIsplay author and date information’ setting
- Select your preferred ‘Menu Settings’
- Save and Add fields
We’ve taken care of the ‘Headline’ in the previous step 3 and by default, we’ll have a ‘Body’ but we still want a field for Date and Image.
Note: Before adding a new field always check the dropdown menu for ‘Select an existing field’; if a field had been used on another content type, you can re-use it here.
- Add Existing Field - Example: Image: field_image (Image) - Save
- On the next page, you can review and customize the configuration options as you prefer and then click ‘Save Settings’
- Add New Field - ‘Article Date’; Field Type: Date; Widget: Pop-up Calendar; Save
- On the next page,you can review and customize the configuration options as you prefer and then click ‘Save Field Settings’
- Again, on the next page, you will most likely leave all the settings to the default, but you can review and customize as you prefer and then click ‘Save Settings’
- Once back on the field settings page, you should now see the default fields along with the two you created and can ‘Save’
MANAGE THE DISPLAY
You will want to adjust the display settings so that your fields are displayed in the order you prefer and you can hide any unnecessary labels.
- Select the ‘Manage Display’ tab
- Using the ‘Four Pointed Arrow’ () drag and drop your fields into the order you prefer; for this example we want; Article Date, Body and Image
- Make any changes to ‘Label’ and ‘Format’; for this example, we want to make the ‘Label’ for page and Article Date hidden
Repeat steps 2-4 for the ‘Teaser’
You have completed creating your new ‘Content Type’ and can begin using it to create new nodes.
CREATE YOUR ARTICLES NODE
Navigate to Content > Add Content > Articles
- Enter your headline - Example: New Partnership with Local Coffeehouse!
- Select your ‘Article Date and Time’
- Enter the details in the ‘Body’
- Select and Upload your ‘Image’
You have now created a node using your new content type ‘Articles’. It can be added to a menu, placed as a link, published to the front page, etc.