Blog Sections Open
Using the `if` Snippet for Multiple Specific Resource IDs
The `if` snippet can handle several resource IDs, but the expression becomes hard to maintain if every case is written inline.
A common menu or layout task is to activate a block only for a small set of specific resources. The old example looked like this:
[!if? &is=`[*id*]:is:183,187,185,186,188,184` &then=`@TPL:main-menu-active` &else=`` !]
and naturally raised the question of how far this pattern should be pushed.
The Main Problem
It can work, but large inline conditions quickly become unreadable. They are also easy to duplicate across templates, which makes maintenance harder later.
Better Options
- keep the list small and documented if the condition is truly static
- move the list into one chunk or configuration point
- switch to parent-based or template-based logic if the pages belong to a real structural group
Practical Advice
If the rule is really “these exact six pages,” the snippet is fine. But if the rule is secretly “all pages in one section,” model the section properly and stop hard-coding IDs. The old question still matters because it points to the moment when a quick condition should become a real content rule.
Handling Pagination and Single-Image Output in EvoGallery
How to think about EvoGallery when the same dataset must support paginated listing output and a separate single-image view.
Why WebLoginPE Registration Can Fail Even When the Form Looks Correct
A practical checklist for WebLoginPE registration failures, especially when instant registration is enabled and the form submits but the user is not created.