Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Use Entry Types for the Love of... Clients

Use Entry Types for the Love of... Clients

Entry Types are the under-appreciated heroes of Craft CMS. With properly used entry types you can create a content model that allows your clients the freedom they expect from a modern CMS. In this session, Stephen will show you how they use Entry Types in our builds at Foster Commerce for both Twig and Nuxt headless projects. For a little spice, we'll explore the edge cases and some arguments against using them. By the end, you'll be singing the praises of Entry Types and we'll start a fan club.

Stephen Callender

October 20, 2021
Tweet

More Decks by Stephen Callender

Other Decks in Technology

Transcript

  1. X

    View Slide

  2. Stephen Callender
    Speaker
    Owner, Strategist, Mover & Shaker

    View Slide

  3. View Slide

  4. 󰚦

    View Slide

  5. View Slide

  6. Use Entry Types

    View Slide

  7. Use Entry Types for
    the Love of… Clients

    View Slide

  8. 1. Craft’s section types
    2. Entry types
    3. Assumptions about the expectations of a CMS
    4. When to use Entry Types vs Singles
    5. (If time) Twig and Nuxt 2 examples

    View Slide

  9. Section type Channel Structure Single
    For content that’s: A uniform
    collection
    Varied but interrelated Standalone
    Relationship to
    other entries
    Flat Hierarchical Independent
    URI format Shared Shared & nested Unique
    Number of entries Many One or more Exactly one
    Manual sorting No Yes N/A
    Multiple entry
    types
    Yes Yes No

    View Slide

  10. What’s an
    entry type?
    “A set of input fields
    that belong to a Section.”
    https://craftcms.com/docs/getting-started-tutorial/configure/modeling.html#assets

    View Slide

  11. 1. ✅ Craft’s section types
    2. ✅ Entry types
    3. Assumptions about the expectations of a CMS
    4. When to use Entry Types vs Singles
    5. (If time) Twig and Nuxt 2 examples

    View Slide

  12. A cornerstone of any content management system is to
    provide — for people who don't know how to write HTML
    — a no-code way to update a website within some
    organizational and design constraints.

    View Slide

  13. 1. It should allow nesting of pages.
    2. It should allow creating pages from reusable
    templates.
    CMS Bare Minimum Assumptions

    View Slide

  14. Listing Page as Entry Type Example

    View Slide

  15. Listing Page as Entry Type Example

    View Slide

  16. Listing Page as Entry Type Example

    View Slide

  17. Listing Page as Entry Type Example

    View Slide

  18. Listing Page as Entry Type Example

    View Slide

  19. But what if the client deletes the page?

    View Slide

  20. But what if the client deletes the page?

    1. Let them!
    2. Trust them!
    3. Use permissions.

    View Slide

  21. “Don’t use architecture to solve a permissions
    problem.”
    — Katie Fritz

    View Slide

  22. Contact Page as Entry Type Example

    View Slide

  23. Contact Page as Entry Type Example

    View Slide

  24. Contact Page as Entry Type Example

    View Slide

  25. But what if the client moves the page, messing
    with SEO concerns?

    View Slide

  26. But what if the client moves the page, messing
    with SEO efforts?

    1. Let them!
    2. Trust them!
    3. What if they want to improve SEO?

    View Slide

  27. 1. It should allow nesting of pages.
    2. It should allow creating pages from reusable
    templates.
    CMS Bare Minimum Assumptions

    View Slide

  28. 1. It’s the homepage.
    2. It’s a utility page that exists whether there’s
    an entry in Craft or not.
    So when is a Single a good idea?

    View Slide

  29. 1. Create a “redirect” entry type.
    2. Create a “hidden” entry type.
    Cool things you can do with entry types

    View Slide

  30. Setting up the “Pages” entry URI format

    View Slide

  31. Setting up the “Pages” section templates

    View Slide

  32. Setting up the “Pages” routing in Nuxt 2

    View Slide

  33. Setting up the “Pages” routing in Nuxt 2

    View Slide

  34. View Slide

  35. Entry Types are the under-appreciated
    heroes of Craft CMS.
    Specifically, Entry Types within a Structure section.

    View Slide

  36. 󰚦
    @sjcallender

    View Slide