First time here? Check out the FAQ!
0

macro hides all other variables?
 

does macro hide all other variables passed from views?

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
pcompassion's avatar
21
pcompassion
asked 11 years ago

Comments

see more comments

1 Answer

0

Yes, Jinja2 macros have only access to variables passed explicitly, or via other special channels that Jinja2 templating uses.

This may be circumvented by creating custom template filter functions as inside functions it is possible to do more.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 11 years ago
link

Comments

see more comments