Twig tip: Ternary operator with an undefined variable

You can use the default filter in combination with the ternary operator 😕 on a variable within a Slim Twig template when the variable is undefined: or in an if statement: When the variable is undefined and should not be an empty string:

Twig tip: How to access the query string

You can access the query string from a Slim Twig template by using the get_uri() method: