Gallery NEW Badges – Original Upload Date and Sorting by Date
Posted: 01 Sep 2026, 06:40
Hi,
I’ve implemented another small feature on my X3 site that marks new content with a “NEW” (NEU) badge.
The logic currently works like this:
- If a blog article is newer than 30 days, it gets a NEW badge.
The main Articles menu item also shows NEW if at least one recent article exists.
- I added the same system to the gallery.
- If a gallery category contains content from the last 30 days, the Gallery menu item and the corresponding gallery category are marked NEW.
- Inside the gallery category, the individual recent gallery entries are marked as well.
- The result is cached locally for performance, so the gallery does not need to be checked again on every page load.
For the gallery entries I’m currently reading:
and using that value as the date.
However, og:updated_time is of course the last modified/updated date, which is not necessarily the same as the date when the gallery entry was originally uploaded or published.
Is there an X3 variable, meta tag or other value available on the gallery detail page that contains the original upload/publication date?
If so, what is the field called? I’d then change the JavaScript to use that date instead of og:updated_time.
I also have one related issue regarding the sorting of my gallery entries.
Ideally, the newest images should always appear at the top of each gallery category. However, after updating some existing gallery entries, the order seems to have changed and is now mixed up.
In the gallery sorting settings I have already selected Date, but this does not seem to give me the expected result.
Is X3 sorting by the last modified date in this case as well, or is there another setting/field I should use if I want the gallery to be sorted strictly by the original upload or publication date, with the newest entries first?
Thanks for any help!
I’ve implemented another small feature on my X3 site that marks new content with a “NEW” (NEU) badge.
The logic currently works like this:
- If a blog article is newer than 30 days, it gets a NEW badge.
The main Articles menu item also shows NEW if at least one recent article exists.
- I added the same system to the gallery.
- If a gallery category contains content from the last 30 days, the Gallery menu item and the corresponding gallery category are marked NEW.
- Inside the gallery category, the individual recent gallery entries are marked as well.
- The result is cached locally for performance, so the gallery does not need to be checked again on every page load.
For the gallery entries I’m currently reading:
Code
<meta property="og:updated_time" ...>However, og:updated_time is of course the last modified/updated date, which is not necessarily the same as the date when the gallery entry was originally uploaded or published.
Is there an X3 variable, meta tag or other value available on the gallery detail page that contains the original upload/publication date?
If so, what is the field called? I’d then change the JavaScript to use that date instead of og:updated_time.
I also have one related issue regarding the sorting of my gallery entries.
Ideally, the newest images should always appear at the top of each gallery category. However, after updating some existing gallery entries, the order seems to have changed and is now mixed up.
In the gallery sorting settings I have already selected Date, but this does not seem to give me the expected result.
Is X3 sorting by the last modified date in this case as well, or is there another setting/field I should use if I want the gallery to be sorted strictly by the original upload or publication date, with the newest entries first?
Thanks for any help!