Skip to content

Fork of Drupal 8's Bartik theme to play with Twig in Drupal 8

Notifications You must be signed in to change notification settings

thamas/mybartik

Repository files navigation

MyBartik :)

Fork of Drupal 8's Bartik theme for my theming presentations (about Twig). (Do Not use Bartik as a base theme in real projects, 'cause updates may break your theme!)

Warning: It looks broken because markup was changed but CSS styling was not written for the new classes! :)

Files to check:

  • block.html.twig
    • add bundle (type) class to blocks
  • field.html.twig
    • new file to add "BEM Element" style class to fields
  • field--node--field-tags.html.twig
    • added first / last classes and tag count using Twig's loop variable
  • menu.html.twig
    • new file
    • added custom css classes (article link below)
  • mybartik.theme
    • preprocess to have "bundle" variable in field.html.twig
    • template suggestions sample for custom block types
  • node.html.twig
    • added new variable: bundle
    • use BEM style class naming where block is the content type
    • added embedded twig block, to split up template to smaller parts
  • node--article.html.twig
    • new file, extends node.html.twig
  • node--article--teaser.html
    • new file, extends node--article.html.twig
    • example usage of "parent"
    • added custom read more link using path function
  • page.html.twig
    • Copyright message using date() filter
    • Current date using format_date
    • Node created and updated date
    • Kint
    • (try to) print content of different node fields

Things to read:

Theming related modules:

About

Fork of Drupal 8's Bartik theme to play with Twig in Drupal 8

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published