I plan to use it for date formatting as follows.
I frequently need to display date/time in the fairly common format of
This requires the following tag
{date format="%Y-%m-%d %h:%i:%s %A"}
Easy enough.
However, crazy though it may seem, I do not have most of the date formatting options committed to memory, and likely never will (there are currently 31 to choose from). Therefore, every time I need to populate the “format=” parameter in the {date} tag, it requires a trip to the documentation to find the codes I need.
The solution? Date formatting constants like {DATE_ATOM}. But wait, there is no date formatting constant equivalent to the format I need.
I can’t make the formatting code a Global Template Variable because it isn’t parsed early enough to be interpreted correctly. I could add the date format as a variable in the path.php file. However I would like to allow a high-level (but not SuperAdmin) administrator the ability to modify this date format if needed without giving them access to the templates or the path.php file. (Yes, I’m a control freak).
That’s where Fresh Variables comes in. I can assign “%Y-%m-%d %h:%i:%s %A” to a nice variable called {DATE_MYWAY}. My {date} tags can now become {date format="{DATE_MYWAY}”} and I suddenly start to giggle like a little girl. I can now use this in 30 templates and if the format ever needs to be changed, change it only once. (Or better yet, allow a lesser minion to do it without worry that they are going to break a template).
Another immediate use I have is this:
One of my clients manages a retail complex. The available retail square footage is displayed in several places around the site. However, the square footage changes on a regular basis. Up to now, I’ve had to update this manually in at least eight templates every time it changes. And I have to do it myself. Now I can give my client access to change a {AVAIL_SQUARE_FOOTAGE} variable and it automatically updates across the site with no intervention from me.
Woohoo!