# Cms image driven

**URL:** <https://forums.realmacsoftware.com/t/cms-image-driven/53466>\
**Category:** Elements\
**Created:** [January 3, 2026, 6:52pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466 "2026-01-03T18:52:02Z")\
**Posts on this page:** 20\
**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 3, 2026, 6:52pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/1 "2026-01-03T18:52:02Z")

</div>

trying using images to control look, still working on my blog layout still a way to go til I get what I want, anyway if of interest, the twig etc file has additional stuff now

im ignoring the single blog page at the moment

---

<div class="post-metadata">

**Author:** ![weaver](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/weaver/32/33079_2.png) [@weaver](https://forums.realmacsoftware.com/u/weaver)\
**Post date:** [January 3, 2026, 9:24pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/2 "2026-01-03T21:24:17Z")

</div>

That’s great @upssjw thanks for sharing.

---

<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 4, 2026, 8:57am UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/3 "2026-01-04T08:57:58Z")

</div>

what if you wanted your blog as a modal menu

---

<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 4, 2026, 9:51am UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/5 "2026-01-04T09:51:34Z")

</div>

same as above but with modal, same blog different page, on page blog list, the other modal blog list

---

<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 4, 2026, 1:53pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/6 "2026-01-04T13:53:40Z")

</div>

project

[elementsapp://downloadDocument/38M2ansnoUl1](elementsapp://downloadDocument/38M2ansnoUl1)

still testing but a little more neater

---

<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 4, 2026, 6:09pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/7 "2026-01-04T18:09:08Z")

</div>

not sure if this will break one page blog, container and item same page, arrgghh

---

<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 4, 2026, 6:13pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/8 "2026-01-04T18:13:33Z")

</div>

might break - one page blog

project

[elementsapp://downloadDocument/zErYkndP08Va](elementsapp://downloadDocument/zErYkndP08Va)

---

<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 5, 2026, 9:46am UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/9 "2026-01-05T09:46:43Z")

</div>

just check modal cms works, [https://sjwjaw.co.uk](https://sjwjaw.co.uk) Blogdd and Easyflex

again just proof of concept

the home page is just entry, not in menu

two blog pages same md files

---

<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 7, 2026, 3:59pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/11 "2026-01-07T15:59:22Z")

</div>

did say last go but could not resist, definitely last go with this design, still not what I want

3 blogs related and search included, featured on first blog, hopefully still works, one is blog on a page

project - [elementsapp://downloadDocument/YEGu41Y51ckR](elementsapp://downloadDocument/YEGu41Y51ckR)

again remove late tonight

---

<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 7, 2026, 7:37pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/12 "2026-01-07T19:37:46Z")

</div>

updated project, blog on a page works fine in Elements, but when uploaded I had to tweak the page address to get the blog to load on first entry, otherwise you get a no item found

this has collection and item components on same page - **this might get broken with Elements updates**

[https://sjwjaw.co.uk](https://sjwjaw.co.uk) BlogSP appears to now load with a blog showing

updated project

I just hid the BlogSP as it was already setup, created a link in the menu and directed it to one of the blogs, in this case

[https://sjwjaw.co.uk/blogsp/?item=today](https://sjwjaw.co.uk/blogsp/?item=today)

Checking on the server highlights a couple of areas need tweaking, not that I will use any of this

---

<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 8, 2026, 9:36pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/13 "2026-01-08T21:36:54Z")

</div>

ok random image from markdown file works, only have set four images, they are almost all the same in each blog so no real visual effect, bonus, all Elements and CMS

---

<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 8, 2026, 9:47pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/14 "2026-01-08T21:47:33Z")

</div>

using this code in the image cms, and pulling the image: eg img1 etc from the markdown, all my markdowns have the same images, not tried on server yet, just add more img’s for more choice, or use in single Item page

project - [elementsapp://downloadDocument/1SJgV8kN3yJv](elementsapp://downloadDocument/1SJgV8kN3yJv)

---

<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 8, 2026, 9:56pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/15 "2026-01-08T21:56:13Z")

</div>

> [@upssjw](#):
>
> [https://sjwjaw.co.uk](https://sjwjaw.co.uk)

just keep refreshing

proof of concept works on server - page randimg

CMS is fairly powerful even at this stage, addicted now to CMS

---

<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 9, 2026, 7:40am UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/16 "2026-01-09T07:40:32Z")

</div>

simple use of CMS to create a random background on load, very basic setup, no blog just random image, only Elements, so many uses, 5 mins work not fully tested will check more after work today

project - [elementsapp://downloadDocument/LxeeXuUCueQV](elementsapp://downloadDocument/LxeeXuUCueQV)

---

<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 9, 2026, 7:50am UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/17 "2026-01-09T07:50:59Z")

</div>

checked on server, just refresh page, definitely now finished with this concept, will remove tonight

[https://sjwjaw.co.uk/contact/](https://sjwjaw.co.uk/contact/)

---

<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 9, 2026, 12:44pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/18 "2026-01-09T12:44:25Z")

</div>

use of CMS different take

global menu background cms driven, random images on load

project - [elementsapp://downloadDocument/nq9ylTFh55jF](elementsapp://downloadDocument/nq9ylTFh55jF)

live site -[https://sjwjaw.co.uk/cmsdata/](https://sjwjaw.co.uk/cmsdata/)

---

<div class="post-metadata">

**Author:** ![Pegasus](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/pegasus/32/25035_2.png) [@Pegasus](https://forums.realmacsoftware.com/u/Pegasus)\
**Post date:** [January 9, 2026, 1:25pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/19 "2026-01-09T13:25:13Z")

</div>

@Steve

I’m trying to achieve something similar to this pattern

```auto
{{ item.image.src | default(item.image.fallback_image) }}

```

The idea is that the **fallback image should always be rendered** whenever **no image is defined in the blog post**.

Unfortunately, this doesn’t work the same way as it does with text fields.

For text, the default filter behaves exactly as expected — but for images it doesn’t, at least not in my current setup.

It seems that Twig does not fully support this syntax for image objects yet, or the image field itself is not resolved as a simple scalar value (like a string), which causes the fallback logic to fail.

That’s why your suggested variant is interesting to me.

This approach works because it directly targets a string value (the image URL), instead of the image object itself. As a result, the default filter can properly evaluate whether the value is empty or missing and then fall back as intended.

I’m going to take a closer look at your solution — it might actually be the right workaround for this limitation.

At the very least, it looks like a solid and pragmatic approach until image fields support the same fallback behavior as text fields.

---

<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 9, 2026, 1:53pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/20 "2026-01-09T13:53:15Z")

</div>

I have tried lots of things image related some work some dont

still playing with the code I have used, not sure or tried might be able to tweak the code

---

<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 9, 2026, 2:34pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/21 "2026-01-09T14:34:03Z")

</div>

[https://twig.symfony.com/doc/3.x/functions/attribute.html](https://twig.symfony.com/doc/3.x/functions/attribute.html)

Warning

---

<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 9, 2026, 8:30pm UTC](https://forums.realmacsoftware.com/t/cms-image-driven/53466/22 "2026-01-09T20:30:05Z")

</div>

also been working with shuffle and an array

the large image on the contact page is an array and shuffle a lot shorter code should be able to add fallback?

the rest of the images are cms random

live site - [https://sjwjaw.co.uk/cmsdata/](https://sjwjaw.co.uk/cmsdata/)

project - [elementsapp://downloadDocument/LLRYj53WrWWt](elementsapp://downloadDocument/LLRYj53WrWWt)

[Next page](https://forums.realmacsoftware.com/t/cms-image-driven/53466.md?page=2)
