Fork of Drupal 8's Bartik theme to play with Twig in Drupal 8
CSS HTML PHP JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
color
config/schema
css
images
templates
logo.svg
mybartik.breakpoints.yml
mybartik.info.yml
mybartik.libraries.yml
mybartik.theme
readme.md
screenshot.png

readme.md

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: