Archived video

This video is archived and won't be updated. We're keeping it online for now as a courtesy.

Alternate resources: 

Twig Global Variables and block function

Video loading...

Transcript language code: 

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:05
    with Leanna Pelham
  • 0:10
    I've got two more bonuses from Twig.
  • 0:13
    In every template, you have access to a variable called app.
  • 0:17
    This has a bunch of useful things on it, like the request, the security
  • 0:21
    context, the user object, and the session.
  • 0:30
    It's actually an object called global variables,
  • 0:34
    which you can check out yourself.
  • 0:37
    So when you need one of these things, remember app.
  • 0:48
    Next, head to our base template.
  • 0:50
    Right now, the title tag is boring.
Loading ...

Twig GlobalVariables and block function


In this tutorial we're going to wrap things up by taking a look at some quick, simple tips for working with Twig. We're going to explain what GlobalVariables is, and then play with the block function and clean up some whitespace issues.

Log in or sign up to download companion files.
Additional resources: