BUGS in Elements CMS Build 1.5.5

I updated to version 1.5.5 two days ago, and since then I have noticed several bugs while using the CMS. Below is a detailed summary of all issues I have encountered.


1. Related Items no longer work

The Related Items feature has stopped functioning — at least once the project is published on my server.

  • Locally and in the Elements Preview, the related items are displayed correctly.
  • On the live website, however, only the message appears:

“No item found”

So something breaks during or after publishing.


2. German date formatting breaks in Collection Items

Using the German date formatting works inside a Single Post Item:

{{item.date_published|format_datetime('long', 'none', locale:'de')}}

But as soon as I use the exact same code inside a Blog List (Collections Item), it no longer works.

So the formatting behaves differently depending on the context, which should not happen.


3. Twig spacing syntax causes errors

I prefer using Twig with spacing for better readability, for example:

{{ item.title }} - {{ item.date_published }} - {{ item.tags }}

This normally works without issues.

However, when spacing is used in a filtered Twig expression such as:

{{ item.date_published | format_datetime('long', 'none', locale:'de') }}

…Elements CMS throws the following error:

Fatal error:

Uncaught Twig\Error\SyntaxError: Unexpected character ’

in __string_template__29fef4eb506be81d2797c94c7ca71f4d at line 24.

It would be extremely helpful if Twig spacing syntax could be supported consistently across all expressions.


4. YAML frontmatter

date:

no longer works

The nested YAML structure below used to work earlier in my projects:

date:
  published: "2022-11-15"
  modified: "2024-02-10"

It still loads without errors, but when I try to output:

{{ item.date.published }}

…the website always displays the current date, not the value that is actually written in the frontmatter.

Because of that, I had to switch back to the old approach:

date_published: "2022-11-15"
date_modified: "2024-02-10"

I would appreciate feedback on this.

This nested format must have worked before, otherwise I wouldn’t have used it in my projects.


Summary

Here are the four issues again in short:

  1. Related Items fail after publishing (only “No item found” online).
  2. German date formatting breaks in Collection Items.
  3. Twig spacing produces syntax errors when used with filters.
  4. Nested YAML date: frontmatter no longer works , always outputting today’s date.

Did not have extra spaces… can’t speak to that…

My date is working fine

————

Question :man_raising_hand: for you… how do you use related items?

I finally got the list to show…

What do you do with it?

I had wanted to find related songs on my site…

How do I program that?

1. Related Items

seems to work, look here, Re-Published All Files with Elements 1.5.5

2. German date formatting breaks in Collection Items

seems to work also, look here

3. Twig spacing syntax causes errors

sorry - but no:

4. YAML frontmatter

never used this - should i

Es tut mir wirklich leid, dass es bei mir alles zu funktionieren scheint und bei Dir nicht. Und es liegt auch nicht daran, dass ich IIS nutze, denn ich habe mir für Tests eine Apache24 Instanz installiert, die ich lokal per http erreichen kann, hier funktioniert es ebenfalls. Gerne helfe ich Dir, melde Dich.

How do I link from a related item to the Post concerned? I’ve tried using {{item.url}} as the link within the Related items {{item.title}} but it doesn’t seem to work (at least previewing in the browser). The link it generates looks correct though.

To be honest, I’m not fully sure yet how to use the related items in the most meaningful way — at least not as long as I can’t get them to work reliably. ^^

I’m probably not using them the way @ben originally intended.

Especially the “author” field: I’m using it differently than it was designed. Because let’s be honest — as long as there’s no external online access and most projects only have one author anyway, the author field isn’t really needed in its classic sense.

Since the current Elements CMS setup allows filtering by tags, but not by categories, I simply repurposed the author field and turned it into my own category system. :wink:

For your example, this would mean you could have “authors” like Rock & Pop, Classic Music, Jazz, etc.

This gives me additional and more flexible filtering options — even though the possibilities with related items are currently still quite limited.

Personally, I prefer using Collection Items, because the built-in filtering options give you much more control over what gets displayed.

Maybe the related items feature will be expanded in the future and allow filtering by categories as well.

Let’s wait and see … but first I need to fix my own related-items problem — which works randomly at best, and currently mostly doesn’t work.

1 Like

Thank you for the detailed response… clever using the authors field…

What no longer works, do you have an error being displayed? The CMS uses the same twig installation across all components, so it seems odd it would work on one page and not another.

I don’t think this is an issue with adding spaces, more that when you add a space after a single quote Elements is converting that to a “pretty quote”, which is an invalid character.

The fix is to delete the curly quote and re-type it as a plain ASCII ' so Twig can parse it correctly.

I will see if we can do some checking in the component/CMS to convert these automatically, hopefully we can improve this in the near future.

I would have to investigate this one, but yes, you should have access to all the custom frontmatter.

The issues in points 2 and 3 are actually caused by the wrong ASCII ’ character — it’s a pretty sneaky problem.

That means: once I replace the incorrect “ASCII ’” after copying or pasting it with the correct character, everything works as expected.

Thanks for pointing that out.

Regarding point 4:

I would really appreciate it if this could be fixed again in one of the upcoming updates.

That only leaves point 1:

There must be something “buggy” here. I simply cannot get the related items to work anymore.

No matter how simple I make the frontmatter … locally, in the preview, all related items are displayed correctly.

But as soon as I publish the page, I only get:

“No item found”

Point 1 has a new Thread:

I didn’t understand what the issue was with point 4. Can you expand on that one?

I would need to see ideally a project, or at least a live URL, before I could even guess at what’s going on here :slight_smile:

Something changed in an early 1.5.x version prior to 1.5.3 that gave me “No item found” on related items. My fix was to update my nginx server block. I have not re-published my site since 1.5.3 to see if anything else has changed that might have broken my nginx server block, but if you run nginx let me know and I’ll share what I have.

The Item not found issue has a new thread:

@ben

Is there any update on this? Did my email with the link to the project arrive, and were you able to identify the issue?

Unfortunately, I’m now also experiencing a problem where newly added CMS items in existing projects are not being displayed online. This mainly affects newly created pages.

As mentioned before, everything looks normal in the preview — but as soon as I publish the project, it only shows “item not found.”

@Pegasus Sorry for the delay, we’ll dig into this tomorrow for you!

Hi @Pegasus

I just replied to your email, but wanted to post here as well for transparency and information to anyone else reading this thread :slight_smile:

In the local preview I can see the related items, but online at https://www.nurkochen.de/kochblog/test/ it only shows “No item found”.

That’s because the Item on the “test” page is set to use a Collection, which means it requires an ?item=slug query parameter. If you visit test you’ll see everything working correctly, including the related items.

Why does this work locally but not when published?
In local preview, if no ?item=slug is present, Elements automatically loads the first item in the Collection so you can preview the individual post template without needing to navigate from the main listing page.

This fallback only happens locally, not on the published site — which is why the live page shows “No item found” unless a valid ?item=slug is provided.

So in short: this behaviour is expected.

Do let me know if you have any more questions :slight_smile:

The related item on the pages in the directory www.kaufsonntag.de/international/belgien/
works correctly. But the related item on the pages in www.kaufsonntag.de/baederregelung-verordnung/bayern/ does not work.

Neither related items component is configured correctly. They’re currently set to fetch related items by author, but you don’t have an authors folder setup. To use author-based relationships, you’d need an authors folder at the same level as each collection.

I’d recommend switching the components to fetch related items by tags instead, that way you can just add the appropriate tag(s) to each post and it will work as expected.

The reason one of the pages may have seemed to work before is due to a previous bug in the Related Items component where it returned items even when none were found. That bug has now been fixed, which is likely where the confusion comes from.

In short: related items are behaving correctly once the component is configured properly.

1 Like

Hi Ben, it would be really useful to have some examples of how to configure a blog to use related items with authors as well as with tags as it isn’t too clear to me how to do this (I’ve been trying to set them up for authors on a test site and can’t figure out how to make it work).

We’re putting together a new CMS Project that is more advanced than the microblog example we currently have available… stay tuned for that!

3 Likes

@ben thanks for the feedback and your explanations.

However, I am very sure there is a bug here. I spent the entire afternoon today setting up very simple test projects… and on pages where it initially worked, the related items stopped working as soon as I added new pages.

I don’t yet know exactly how or when the issue occurs, but I think I’m getting closer to identifying it.

I’ll get back to you as soon as I’ve found the cause of the problem.

@dan @ben YEAH! I think I finally figured it out…

It seems to be a Markdown parser issue, specifically related to how the Markdown files are named.

I tested several Markdown files with different file names.

Normally, when you create a new Markdown page via the Elements tool (“Create a new Markdown page”), the files are generated like this:

2025-month-day_title.md

However, when Markdown files are named simply:

one.md
two.md
three.md
four.md
five.md

…the related items feature does not work, even though all parameters in the frontmatter are identical.

But as soon as the Markdown files are renamed to something like:

site-one.md
site-two.md
site-three.md
site-four.md
site-five.md

…the related item functionality works again.

So it looks like the parser has trouble when the file name contains no hyphen or underscore before the first segment, which many people might run into if they name their blog articles only after the title.

As a result, this can cause issues when generating related items, because the system expects a certain naming pattern before the first “-” or “_”.

Attached is a Markdown file overview from my test project.

Red = related items do NOT work
Green = works

It looks like the Markdown parser always commits to only one “version.”

I tested this by deleting all Markdown files.

After uploading them again, all the files that were previously marked red suddenly worked, and the green ones stopped working.

1 Like

Trying to understand…

Use 00001

00001name.md

Or

Don’t use 00001

name.md

Thanx :slight_smile:

Mike