# Get variable from Tera template

**URL:** <https://zola.discourse.group/t/get-variable-from-tera-template/1176>\
**Category:** Support\
**Created:** [February 11, 2022, 12:17am UTC](https://zola.discourse.group/t/get-variable-from-tera-template/1176 "2022-02-11T00:17:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![biralo](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/biralo/32/807_2.png) [@biralo](https://zola.discourse.group/u/biralo)\
**Post date:** [February 11, 2022, 12:17am UTC](https://zola.discourse.group/t/get-variable-from-tera-template/1176/1 "2022-02-11T00:17:20Z")

</div>

Sorry, not exactly a Zola question, but I think 99% of the Tera knowledge in the world lives here.  
We have a template which I’d like to store some meta-info and be able to get that out (TBC: from the template, not the context).  
We’re printing PDFs from HTML using headless-chrome, generated from Tera, and for instance we’d like the template to tell us the page orientation. I can see a hack of rendering it twice, once with a context that tells the template to render just the meta section, but I’m sure I’m missing a proper way. (Tera is great, BTW - 🙏 )  
p.s. I know doing this in CSS is possible- not convinced it’s reliable for printing.

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [February 11, 2022, 10:26am UTC](https://zola.discourse.group/t/get-variable-from-tera-template/1176/2 "2022-02-11T10:26:09Z")

</div>

Sorry I’m not sure I fully understand. The template only gets the `Context` so what do you want to get out of the template? Some values set by `{% set = ... %}`?

---

<div class="post-metadata">

**Author:** ![biralo](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/biralo/32/807_2.png) [@biralo](https://zola.discourse.group/u/biralo)\
**Post date:** [February 14, 2022, 1:13am UTC](https://zola.discourse.group/t/get-variable-from-tera-template/1176/3 "2022-02-14T01:13:13Z")

</div>

Hi, yes, something like that.  
We realise it’s “non-standard” - the alternative for us is to embed the info in the template in another way, and then read either the template or the generated HTML file to get the info- not hard to do, but thought it would be nice to do with Tera.  
Thanks, Craig
