# Compenent objects

**URL:** <https://zola.discourse.group/t/compenent-objects/2974>\
**Category:** Support\
**Created:** [August 27, 2026, 1:59pm UTC](https://zola.discourse.group/t/compenent-objects/2974 "2026-08-27T13:59:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlie137](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/charlie137/32/1140_2.png) [@charlie137](https://zola.discourse.group/u/charlie137)\
**Post date:** [August 27, 2026, 1:59pm UTC](https://zola.discourse.group/t/compenent-objects/2974/1 "2026-08-27T13:59:10Z")

</div>

New syntax forces me to pass internal objects to components now:

`{{ <img src="foo.bar" page={page} config={config} /> }}`

Is there a way around?

---

<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:** [August 27, 2026, 3:54pm UTC](https://zola.discourse.group/t/compenent-objects/2974/2 "2026-08-27T15:54:29Z")

</div>

> <https://github.com/Keats/tera/issues/996>
>
> Hello!
> 
> First, thanks a lot for the new major version!! A lot of good and very w…elcomed improvements!!!
> 
> I was working on migrating my code base to Tera v2 and wanted to make full use of the newly available \`State\` in custom functions. I have a \`tr\` function to handle the translations and wanted to avoid having to pass the language to each function call in the templates, so I insert my \`lang\` variable in the Tera \`Context\` in Rust before rendering and get it back from the \`State\` in the function.
> 
> This is working just fine but when it comes to components, because of their "private" context, the function \`State\` does not contain the language. I have worked around that by explicitly passing my \`lang\` variable to the components, but I don’t really like that it is somethings that’s more of a implementation detail rather than a component argument.
> 
> Would it be an idea to have globals in the context or would that defeat the point of components? I’m not sure how to handle this use case properly and if that’s a good use of the \`State\` in functions…
> 
> Thanks :)
