# How to use variables from site.yml in panel textarea to later expand on front end?

**URL:** <https://forum.getkirby.com/t/how-to-use-variables-from-site-yml-in-panel-textarea-to-later-expand-on-front-end/33323>\
**Category:** Questions\
**Created:** [January 13, 2025, 2:03am UTC](https://forum.getkirby.com/t/how-to-use-variables-from-site-yml-in-panel-textarea-to-later-expand-on-front-end/33323 "2025-01-13T02:03:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AmberChase](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/amberchase/32/16067_2.png) [@AmberChase](https://forum.getkirby.com/u/AmberChase)\
**Post date:** [January 13, 2025, 2:03am UTC](https://forum.getkirby.com/t/how-to-use-variables-from-site-yml-in-panel-textarea-to-later-expand-on-front-end/33323/1 "2025-01-13T02:03:51Z")

</div>

Hi there,

For a project, I’ve created global fields like “maximum respond date,” “average shipping date,” and “fee,” etc. in site.yml

Now, I need to build out the terms and conditions, as well as some legal pages, and reference these variables throughout the text.

In the legal.yml file, I have a text area.

My question is: how can I ensure that {{ site.shipping\_date }} is populated with the actual value?

For example, here’s what my panel text looks like:

`We are pleased to inform you that your order will be shipped by {{ site.shipping_date }}. Please ensure that you are available for delivery on or after this date. Thank you for choosing us!`

However, I’m having trouble figuring out how to get it to display the actual value. I perfectly can see all the markup bold, italic, lists, etc… but not the actual Shipping\_date or other variables.

In my legal.php file, I’m using, so it keeps the styling of the textarea:

`<?= $page->text()->kt() ?>`

Any insights would be greatly appreciated!

Thanks.

---

<div class="post-metadata">

**Author:** ![bvdputte](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bvdputte/32/8179_2.png) [@bvdputte](https://forum.getkirby.com/u/bvdputte)\
**Post date:** [January 13, 2025, 8:55am UTC](https://forum.getkirby.com/t/how-to-use-variables-from-site-yml-in-panel-textarea-to-later-expand-on-front-end/33323/2 "2025-01-13T08:55:34Z")

</div>

In a `textarea` field that you display in the template via `->kt()` you could use a custom [Kirbytag](https://getkirby.com/docs/reference/plugins/extensions/kirbytags) to achieve want you’re after.

Within your Kirbytag you can basically program whatever you want to happen.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 13, 2025, 9:21am UTC](https://forum.getkirby.com/t/how-to-use-variables-from-site-yml-in-panel-textarea-to-later-expand-on-front-end/33323/3 "2025-01-13T09:21:14Z")

</div>

You can use Str::template to replace those placeholders

> **[Placeholders](https://getkirby.com/docs/cookbook/content-structure/use-placeholders)**
>
> Use placeholders for recurring text snippets and more

---

<div class="post-metadata">

**Author:** ![AmberChase](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/amberchase/32/16067_2.png) [@AmberChase](https://forum.getkirby.com/u/AmberChase)\
**Post date:** [January 13, 2025, 10:34pm UTC](https://forum.getkirby.com/t/how-to-use-variables-from-site-yml-in-panel-textarea-to-later-expand-on-front-end/33323/4 "2025-01-13T22:34:09Z")

</div>

Thank you both, after some experimentation, placeholders seems the way to go. I will experiment later with tags!

Thank you!

---

<div class="post-metadata">

**Author:** ![AmberChase](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/amberchase/32/16067_2.png) [@AmberChase](https://forum.getkirby.com/u/AmberChase)\
**Post date:** [January 13, 2025, 10:46pm UTC](https://forum.getkirby.com/t/how-to-use-variables-from-site-yml-in-panel-textarea-to-later-expand-on-front-end/33323/5 "2025-01-13T22:46:52Z")

</div>

Thank you.  
Good to know about kirbytags. However I will probably go with placeholders as it is easier to define in the panel. I have this client that wants to change basically everything themselves for those legal pages.

All the best.

---

<div class="post-metadata">

**Author:** ![bvdputte](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bvdputte/32/8179_2.png) [@bvdputte](https://forum.getkirby.com/u/bvdputte)\
**Post date:** [January 14, 2025, 7:47am UTC](https://forum.getkirby.com/t/how-to-use-variables-from-site-yml-in-panel-textarea-to-later-expand-on-front-end/33323/6 "2025-01-14T07:47:45Z")

</div>

Great! It might be interesting to know about `i18n::template()` too, in case the website needs to be multilingual!
