Blog Sections Open

Working Safely with a price TV and PHx Modifiers

A template troubleshooting note for cases where a custom TV prints correctly but PHx modifiers fail on resource fields such as pagetitle.

It is common to see a custom TV such as render correctly while a PHx-style modifier on another field seems to fail. That usually points to parser context or modifier compatibility, not to the TV itself.

The symptom

In the source case, worked, but expressions like returned nothing in the same template area.

What to check

  • whether PHx is enabled and loaded correctly
  • whether the tag is being parsed in a context that allows modifiers
  • whether another plugin changes parser behavior early in the request
  • whether the project mixes old PHx patterns with newer parser assumptions

A safer approach

For business-critical output such as prices, do not rely on parser tricks alone. Normalize or transform the value in a snippet, controller, or prepare method so the template receives exactly the string you want to print.

<?php
$price = trim($modx->documentObject['price'] ?? '');
$title = mb_strtolower($modx->documentObject['pagetitle'] ?? '');
?>

Why this matters

PHx can still be useful in legacy projects, but the more essential the value is, the safer it is to make the transformation explicit in code rather than depend on parser edge cases.

Newer post

Making Pagination Meta Tags Unique with DL Placeholders

A practical SEO note on appending page numbers to title and description fields for paginated listings in Evolution CMS.

Older post

Fixing HTTPS Redirects and Mixed Content on Masterhost

A deployment troubleshooting note for Evolution CMS sites that redirect to HTTPS but still load some manager or frontend assets over HTTP, causing mixed-content errors.