Blog Sections Open

Preprocessing TV Values Before Saving a Resource

A practical save-time pattern for Evolution CMS projects where TV values need transformation before they are stored.

If a TV value always needs cleanup, normalization, or conversion, doing that work in the output layer is usually the wrong place. A better pattern is to process the value before the resource is saved.

When this helps

  • Text TVs need trimming, normalization, or slug-like cleanup.
  • One TV should be derived from another field.
  • Editors enter human-friendly values that the project stores in a normalized form.

Typical approach

Use a save-time plugin or manager-side hook so the TV is transformed once, then stored consistently. That keeps templates simpler and avoids repeating the same cleanup on every render.

The key rule is simple: if the stored value should always follow one rule, enforce that rule on save, not in every chunk and snippet later.

Newer post

Showing Multiple Resource Markers on a Yandex Map with ddYMap

How to render several Evolution CMS resources as Yandex map markers using ddYMap and a Ditto-powered marker list.

Older post

Translating YAMS URL Rewrite Rules for IIS7

How to adapt a YAMS multilingual URL setup from Apache-style rewrite rules to IIS7 URL Rewrite without breaking context prefixes such as /en and /ru.