ThermX Snippet Tutorial

If you use this extra and like it, please consider donating. The suggested donation for this extra is $5.00, but any amount you want to give is fine (really). For a one-time donation of $50.00 you can use all of my non-premium extras with a clear conscience.

This snippet is for use with MODX Revolution. ThermX creates a fundraising thermometer for placement on a web page.

Update note

The method for formatting the money amount has changed in the latest version, due to the deprecation of PHP's money_format() function. The &thermxFormat property is gone.

Use the &thermxLocale property if you want something other than the default locale, which is en_US.

Minimal Snippet Tag

[[!ThermX? &thermxProgress=`2500` &thermxMax=`7500`]]

Properties

&thermxProgress  -- Current amount raised

&thermxMax       -- Fundraising goal

&thermxLocale    -- [optional] locale for money format
                    defaults to 'en_US'

Placeholders

[[+thermx_progress]]    -- Put this where you want the
                           current amount raised to appear.

[[+thermx_thermometer]] -- Put this where you want the
                           thermometer to appear.

Example Page Content

[[!ThermX? &thermxProgress=`2500` &thermxMax=`7500`]]

 <p>Our progress so far: [[+thermx_progress]]</p>

[[+thermx_thermometer]]

Troubleshooting

If you see the numbers, but not the thermometer, make sure the thermometer page is attached to a template that exists, and has a head and body section in its HTML.

 

My book, MODX: The Official Guide - Digital Edition is now available here. The paper version of the book may still be available from Amazon.

If you have the book and would like to download the code, you can find it here.

If you have the book and would like to see the updates and corrections page, you can find it here.

MODX: The Official Guide is 772 pages long and goes far beyond this web site in explaining beginning and advanced MODX techniques. It includes detailed information on:

  • Installing MODX
  • How MODX Works
  • Working with MODX resources and Elements
  • Using Git with MODX
  • Using common MODX add-on components like SPForm, Login, getResources, and FormIt
  • MODX security Permissions
  • Customizing the MODX Manager
  • Using Form Customization
  • Creating Transport Packages
  • MODX and xPDO object methods
  • MODX System Events
  • Using PHP with MODX

Go here for more information about the book.

Thank you for visiting BobsGuides.com

  —  Bob Ray