Twig Super Power Roundup (Craft CMS 3)

4290b85f3c89cdcb082b28b3f8dc334a?s=47 Jason Mayo
November 01, 2018

Twig Super Power Roundup (Craft CMS 3)

Talk given at Craft CMS Manchester Meetup #12. Pulls together all the TWIG tips gained from DotAll2018 + some.

4290b85f3c89cdcb082b28b3f8dc334a?s=128

Jason Mayo

November 01, 2018
Tweet

Transcript

  1. 3.
  2. 4.
  3. 10.
  4. 11.
  5. 17.

    Null-Coalescing Operator Returns the rst value if it is de

    ned and not null, otherwise second value Plugin (Better) version - https://github.com/nystudio107/craft-emptycoalesce
  6. 20.

    atoms Atoms are the basic building blocks of matter. Applied

    to web interfaces, atoms are our HTML tags, such as a form label, an input or a button.
  7. 21.

    molecules Molecules are groups of atoms bonded together and are

    the smallest fundamental units of a compound. For example, a form label, input or button aren’t too useful by themselves, but combine them together as a form and now they can actually do something together.
  8. 22.

    organisms Molecules give us some building blocks to work with,

    and we can now combine them together to form organisms.
  9. 28.

    Tailwind / Utility Class If using utility classes e.g. Tailwind,

    go a step further to make molecules more customisable using Colours, Transitions etc. Using Dynamic Fields.
  10. 29.
  11. 30.

    Include Utility Macro Output the utitlity via a macro so

    it can be reused through multiple molecules / atoms