Keats / tera

A template engine for Rust based on Jinja2/Django
http://keats.github.io/tera/
MIT License
3.36k stars 280 forks source link

i want to add errors / success flash messages globals #878

Closed HosMercury closed 7 months ago

HosMercury commented 7 months ago

how to get the flash messages / success msg / errors msg by having the ability to have globals/locals?

Keats commented 7 months ago

When you say globals, you mean a context that is passed to every render?

HosMercury commented 7 months ago

I mean something is sometimes sent to the( base.html ) like flash messages. it will always be in the base it should appear if I send them to a specific page descended from the base.html otherwise nothing should happen.

so the variable will be in the base.html, not the child page. without that. I have to send that variable with every context which sometimes I do not need to do

HosMercury commented 7 months ago

there ??