Blog Sections Open
Finding the Maximum Numeric Value Stored in a TV Field
Because TV values are stored as text, numeric comparisons need explicit ordering logic if you want true maximum and minimum results.
TV values in Evolution CMS are stored as strings, so a simple MAX(value) does not always behave the way you want when the values are really numbers.
Useful SQL pattern
$q = "SELECT value FROM " . $modx->getFullTableName('site_tmplvar_contentvalues');
$q .= " WHERE tmplvarid=9 ORDER BY value = 0, - value DESC, value LIMIT 1";
Why this matters
Without numeric-aware ordering, text storage can make “100” sort before “9” or produce other misleading results.
Recommendation
Whenever a TV is conceptually numeric, treat the SQL accordingly. If the project depends on repeated numeric comparisons, consider whether the data should really stay in a TV at all.
Showing Recent JotX Comments from Selected Pages
A recent-comments block works best when the comment source scope is explicit — otherwise the widget can quietly fall back to comments from everywhere.
Choosing the Right Architecture for a Large Fabric Sample Catalog
A catalog with 1,000–1,500 items needs more than a simple list snippet — it needs a content model that stays manageable as filters, images, and prices grow.