# Using twig/cms in custom component

**URL:** <https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829>\
**Category:** Elements API\
**Created:** [January 23, 2026, 7:18am UTC](https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829 "2026-01-23T07:18:42Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [January 23, 2026, 7:18am UTC](https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829/1 "2026-01-23T07:18:42Z")

</div>

I have created a lot of different setups as practice, really like this addition, for my use this is great as I can edit the data in the tables on my server, now hooked on this

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [January 23, 2026, 8:26am UTC](https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829/2 "2026-01-23T08:26:30Z")

</div>

That’s looking nifty, nice work!

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [January 23, 2026, 9:35am UTC](https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829/3 "2026-01-23T09:35:23Z")

</div>

really liking this challenge, I messed up the table not putting headers in the right place was more interested in getting it to work, trying to build a menu from the titles at the moment

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [January 23, 2026, 12:20pm UTC](https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829/4 "2026-01-23T12:20:45Z")

</div>

ok really liking this now, had to get info from another online store selling these items, American copy and paste excuse the spelling

---

<div class="post-metadata">

**Author:** ![PMUK](https://avatars.discourse-cdn.com/v4/letter/p/7993a0/32.png) [@PMUK](https://forums.realmacsoftware.com/u/PMUK)\
**Post date:** [January 23, 2026, 12:28pm UTC](https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829/5 "2026-01-23T12:28:33Z")

</div>

Amazing! OK next challenge get colour swatches in and make item change colour for different items! 🙂

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [January 23, 2026, 12:31pm UTC](https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829/6 "2026-01-23T12:31:33Z")

</div>

just had to sort out responsive set wrong screen sizes, I also wrote books for some reason

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [January 23, 2026, 12:32pm UTC](https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829/7 "2026-01-23T12:32:03Z")

</div>

thats a bit more work

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [January 23, 2026, 12:47pm UTC](https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829/8 "2026-01-23T12:47:19Z")

</div>

Because of Elements I decide to learn Tailwind and CSS to a level I need, still working on Alpine, also Elements API and now Twig, not enough time or space in my brain - Twig is now daily reading, need to understand where or how you use all of this or if needed, I am glad I worked my way through producing a menu in Elements it helped on loops. Realmac no more please 😂 🤣 😅 😪 😣 😓 for a while anyway

---

<div class="post-metadata">

**Author:** ![thominator](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/thominator/32/35233_2.png) [@thominator](https://forums.realmacsoftware.com/u/thominator)\
**Post date:** [January 23, 2026, 12:56pm UTC](https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829/9 "2026-01-23T12:56:17Z")

</div>

_ **Introducing** _…_ **GetTwiggyWithIt** _

This new templating of the twig templating system saves you time, as it replaces all that typing between curly braces with a single character, e.g. {{a}}. All you need to do is set up a translation table in your header code, and now all these abbreviated twigs become smaller sticks.

But wait, there’s more! If you buy into this today we’ll also give you TailwindBooster, which installs a fan behind your Tailwind code to make it faster than ever before.

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [January 23, 2026, 1:24pm UTC](https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829/10 "2026-01-23T13:24:51Z")

</div>

{% set d = prices2 ?? item.prices2 ?? page.prices2 %}

{% set c = table\_config ?? item.table\_config ?? page.table\_config %}

etc

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [January 23, 2026, 2:15pm UTC](https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829/11 "2026-01-23T14:15:30Z")

</div>

@PMUK

the items are just 🍽 🥣 etc so I would have to create the product, anyway this is just practice, maybe when I work my way through this etc [https://twig.symfony.com/doc/3.x/](https://twig.symfony.com/doc/3.x/)

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [January 23, 2026, 2:24pm UTC](https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829/12 "2026-01-23T14:24:27Z")

</div>

I did up load to my site and changed the price on all 3 works a treat, although with even normal cms components you can change in the markdown, as long as you dont need to keep synced you can change the Elements part at the same time

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [January 23, 2026, 4:38pm UTC](https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829/13 "2026-01-23T16:38:57Z")

</div>

I just watched Transformers while working this

I already have tables setup, probably missed a few from previous test to update from previous project, just copy and paste mostly, looked at the math, logical operators this gives me a headache anyway so going to a while before I work through that completely, can do simple

the status does update depending on stock levels

I am addicted to Elements my wife is going to leave me 🤣 she used to work in retail never really new what sku was

this really hurts my head

The spaceship operator (`<=>`) is used for comparing two expressions. It returns `-1`, `0` or `1` when the first operand is respectively less than, equal to, or greater than the second operand.

Don’t understand yet

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [January 23, 2026, 4:59pm UTC](https://forums.realmacsoftware.com/t/using-twig-cms-in-custom-component/53829/14 "2026-01-23T16:59:40Z")

</div>

@dan I started here to use Twig, both the endraw’s are wrong ??
