CMS

Week 7

Content modeling

Overview

  • Week 7
    • Content modelling
    • Drupal as a backend
  • Week 8 - Project
    • Full Briefing Project
    • Setting up
    • Implementing a content model
  • Week 9 - Project
    • Adding an editable theme
    • Implementing views

Overview

  • Week 10 - Project
    • Implementing views advanced
    • Adding more structure
  • Week 11 - Project
    • Adding QOL
    • User management
  • Week 12 - Project
    • Wrapping up - Go live

Get a hosting

by next week!

versio.nl, antagonist.nl, combel, one.com, etc.

Any standard webhosting (php+mysql) will do!

 

We will install our project on a live hosting, so we don't have to deal with transferring it later on.

 

Doing this later is allowed,
in that case just use Acquia DevDesktop for now.

Content modeling

RECAP

Qu'est-ce que c'est?

Content modeling is the process of creating content models that describe structured content.

 

"Content models are an effective way of keeping a multi-disciplined project team aligned in their understanding of structured content.  A firm and shared grasp on the structure and semantics of content, leads to more innovative ways to adapt it downstream."

 

Unstructured content is stupid and old-fashioned.

It’s costly, complex and does not generate a competitive advantage.

 

- Ann Mulhay, ex-CEO of Xerox

What is NOT a content model?

 

  • a site map depicting a top-down view of web site pages.
  • a navigational scheme for describing how users get from A to B.
  • page types outlining how content should be laid out on a page.

What is a content model?

A content model is a representation of the types of content and their inter-relationships.

 

For example:

  • a car dealership may have content types for Vehicle, Dealer, and Manufacturer because these are first class citizens in the business domain.
  • a restaurant have Recipes, Chef, Menu and Venue.

 

The aim of the content model is to identify these content types, model their relationships and provide a shared semantic understanding of content from sponsor to developer.

Hard?

Content models appear to be the black sheep of information architecture.  They are seldom done.

 

The perception is that they are difficult and depend upon less understood things such as metadata and taxonomy.

 

In fact, content modeling (or content modelling) is a highly creative activity and freakishly awkward to get right.

 

But difficult? No!

 

What do content models look like?

A content model may be a diagram on a whiteboard, a pile of cards describing your information products and services, an excel spreadsheet, or a fancy content modelling tool used by geographically distributed teams.

 

All or none of them may be appropriate for your particular situation.

What do content models look like?

What is important is that there is agreement on what the content is and the way it’s communicated between the cross-disciplined teams.

 

That is what the content model should bring to the table.

 

The means to define, describe, disseminate and discuss content.

Confused?

Think of SQL schemes!

There are no hard or fast rules for what a content model should look like.

Content modeling

In Drupal 8

What tools does D8 offer us?

Content types

 

Fields

 

Taxonomies

Content types or nodes

A Content Type is a set of fields for a particular type of data.  For example, the simplest content type is a Basic page. It has a Title and a Body field.

 

Most content on a Drupal website is stored and treated as "nodes". A node is any piece of individual content, such as a page, poll, article, forum topic, or a blog entry.

 

Treating all content as nodes allows the flexibility to create new types of content. It also allows you to painlessly apply new features or changes to all content of one type.

Nodes have fields

A Content Type is a set of fields for a particular type of data.

 

Each Content type has its own set of fields.

 

 

Fields don't have to be Text!

 

You can use images, files, references, links, dates, emails, ... and many others!

Taxonomies

Taxonomy, a powerful core module, gives your sites use of the organizational keywords known in other systems as categories, tags, or metadata.

 

It allows you to connect, relate and classify your website’s content.

 

In Drupal, these terms are gathered within "vocabularies". The Taxonomy module allows you to create, manage and apply those vocabularies.

Taxonomies also have fields

Just like Content types, Taxonomies also have fields.

 

You can add new fields, manage the add/edit form and customise (multiple) display(s), just like with any type of content!

Everything is an entity

Example

Car Dealership

Context

Let's use a virtual example for a non-existant car dealership: IMD CARS

 

Our car dealership is specialised in selling different brands of german cars: VW, Audi, BWM, ...

 

Cars are sold New, or Second-hand.

 

Each car has a body type: Hatchback, Sedan, SUV, Coupe, Crossover, ...  

 

Context

Each car sold has a: brand, body type, description, serial number, price, mileage, color, interior color, number of doors, transmission-type, fuel-type, build-year, power (BHP), cylinder capacity, ...

 

See online for examples: https://www.2dehands.be/autos/mercedes-benz/e-klasse-break/mercedes-e280-v6-cdi-avantgarde-470581506.html  

 

Context

Our dealership IMD CARS wants us to build their new website.

 

There should be some simple pages (Basic pages) like about-us.

 

We will define and add different types of content and add views to view/filter the content.

 

Users should be able to easily find cars for sale based on the different options.  So it is important to use references (like taxonomy or content).

Exercise

Based on the context:

  • Find a partner (by yourself is fine too... corona...)
  • Agree on a tool
    • Paper
    • Spreadsheet
    • Mockups
    • Lucidchart
    • SQL Server Database Modeler
    • ...
  • Create a diagram describing the content-types, fields & relationships
    • See following example
    • Add/Define more fields

Exercise: Example

Content type: Brand

 

Fields:

  • brand name -> Title field
  • description -> Text field (long)
  • logo -> Image field
  • address -> Text field
  • etc...

Exercise: Example

Content type: Car

 

Fields:

  • name -> Title field
  • description -> Text field (long)
  • brand -> Node reference: Content-type Brand
  • serial number -> Text field
  • price -> Number field
  • color -> Taxonomy: Exterior color
  • transmission-type -> Taxonomy: Transmission
  • etc ...

Exercise: Example

Taxonomy: Fuel

Diesel, Gasoline

 

Taxonomy: Body type

Hatchback, Sedan, SUV, Coupe, Crossover, ...  

 

Taxonomy: Sale state

New, Second hand

 

Etc...

Confused?

Think of SQL schemes!

Practice

Let's turn out model into reality

Setup

  1. Create a new Drupal 8 site
  2. Call it IMD CARS
  3. Use the Standard install profile

Adding content-types

Brand

Add CT: Brand

  1. Go to admin/structure
  2. Click Content types
  3. Click Add content type
    1. Enter a Name
    2. Optional description
    3. Set Title field label to Brand name
    4. Unset Promoted to front page
    5. Unset Display author and date information
    6. Unset Available menus
  4. Hit Save and manage fields

Add Fields: Brand

  1. Go to admin/structure/types/manage/brand/fields
  2. On the Body field click Edit
    1. Change the Label to Description
    2. Hit Save
  3. Click Add field
    1. On the dropdown Add a new field, select Image
    2. Enter label: Logo
    3. Set Minimum image resolution to 200x200px
    4. Unset Alt field required
    5. Hit Save
  4. ​Add more fields

Manage form: Brand

  1. Go to admin/structure/types/manage/brand/form-display
  2. Set these fields to Disabled
    • Authored by
    • Authored on
    • Promoted to front page
    • Sticky at top of lists
  3. Re-arrange the remaining fields in a logical order

Manage display: Brand

  1. Go to admin/structure/types/manage/brand/display
  2. Under Custom display settings select Full content & Teaser
    1. Save
  3. Click on Full content
    • admin/structure/types/manage/brand/display/full
  4. Re-arrange the fields as you want
  5. Change label display
  6. Change display values

Add content: Brand

  1. Go to admin/content
  2. Hit Create content
  3. Choose Brand
  4. Create a few Brands
    1. ​VW
    2. Audi
    3. BMW
  5. ​Review the results, update manage display Full Content if needed

Adding content-types

Car

Add CT: Car

  1. Go to admin/structure
  2. Click Content types
  3. Click Add content type
    1. Enter a Name
    2. Optional description
    3. Set Title field label to Car name
    4. Unset Promoted to front page
    5. Unset Display author and date information
    6. Unset Available menus
  4. Hit Save and manage fields

Edit Fields: Body

  1. Go to admin/structure/types/manage/car/fields
  2. On the Body field click Edit
    1. Change the Label to Description
    2. Hit Save

Add Fields: Brand

Let's link our Car to a Brand.

  1. Go to admin/structure/types/manage/car/fields
  2. Click Add field
    1. ​​On the dropdown Add a new field, select Reference - Content
    2. Enter as Label: Brand
    3. Only allow 1 entry
    4. Set field as Required
    5. Limit the references to content-type Brand
      • ​​Sort by Title - ASC
    6. ​​Hit Save

Add Fields: Brand cntd.

  1. Go to admin/structure/types/manage/car/form-display
  2. On the field Brand
    • Set widget type to Select list

 

We have now added a reference field, try it out!

  1. Go to admin/content
  2. Hit Create content
  3. Choose Car
    1. ​Fill in some values
    • ​No need to save yet

 

 

 

 

 

 

 

 

 

  1.  

Content references

Content references allow us to reference any type of content. Use these to link content-types to each other.

 

Example use-case:

 

Node type: Book

Content type: Author

 

"Each book has an author"

Add a reference: CT Book -> CT Author.

Add Fields: Fuel

Now let's add a fuel type selection.

 

Options:

  • Diesel
  • Gasoline

Add Taxonomy: Fuel type

  1. Go to admin/structure/taxonomy
  2. Click Add vocabulary
    1. Enter name: Fuel
    2. Optional description
    3. Hit Save
  3. Click Add term
    1. Enter name: Diesel
    2. Optional description
    3. Hit Save
    4. Enter name: Gasoline
    5. Optional description
    6. Hit Save

Add Field: Fuel type

  1. Go to admin/structure/types/manage/car/fields
  2. Click Add field
    1. ​​On the dropdown Add a new field, select Reference - Taxonomy term
    2. Enter as Label: Fuel type
    3. Only allow 1 entry
    4. Set field as Required
    5. Limit the references to Vocabulary Fuel
      • ​​Sort by Title - ASC
    6. ​​Hit Save

Add Field: Fuel type

  1. Go to admin/structure/types/manage/car/form-display
  2. On the field Fuel
    • Set widget type to Select list

 

We have now added a reference field, try it out!

  1. Go to admin/content
  2. Hit Create content
  3. Choose Car
    1. ​Fill in some values
    • ​No need to save yet

Taxonomy

Taxonomy allows us to define Vocabularies.

 

These are basically simple lists of terms. 

 

Example use-cases:

Color: Red, Green, Blue

"This shirt is Red"

 

Role/Function: CEO, COO, Employee, Student, Teacher

"I am an Employee" 

 

Exercise

Add all the other fields you have described in the content-model.

Manage display: Car

  1. Go to admin/structure/types/manage/car/display
  2. Under Custom display settings select Full content & Teaser
    1. Save
  3. Click on Full content
    • admin/structure/types/manage/car/display/full
  4. Re-arrange the fields as you want
  5. Change label display
  6. Change display values

Add content: Car

  1. Go to admin/content
  2. Hit Create content
  3. Choose Car
  4. Create a few Cars
    1. ​VW Golf
    2. Audi A3
    3. BMW 1
  5. ​Review the results, update manage display Full Content if needed

Question:

Our Car Dealer wants to start selling motorcycles.

How would you handle this?

CMS W7 18-19

By Pieter Mathys

CMS W7 18-19

Content modeling

  • 987