My top five ways Low Variables extends EE’s flexibility

Mike Wenger / Posted 9.18.2012

My top five ways Low Variables extends EE’s flexibility

Low Variables is an add-on that until recently I had not had the need/opportunity to use. It will likely be on my base EE install list from now on. I found Low Variables to be an incredibly simple and powerful way to increase Expression Engine's flexibility. Think of it like Pilates for your EE core.

The Low-Down on Variables.

If you're familiar with EE, you know about Snippets and Global Variables, and the limitations of such. Snippets are great for pre-replacement and dynamic chunks that you can reuse, but I find it can be cumbersome to work on these in the admin - I prefer editing in my favorite text editor. Global Variables are parsed last, and therefore, may only contain static code. Here are two methods of reusable content in two different places that don't quite satisfy the needs for reusable/global content.

The functionality of Snippets and Global Variables are rolled into Low Variables, with options galore.

  • You have the option to enable early parsing on a Low Variable, which will parse it at stage one, effectively making it a snippet.
  • You can use the template tag ( {exp:low_variables:parse var="my_var"} ) to parse at stage five just like module tags.
  • Or you have the option to not enable early parsing, to parse at stage nine, making them essentially Global Variables.

As an added bonus, you now have one place for all these types of includes/variables, and by way of Low Variables options, you can save them to the server as text file. No more editing large amounts of code in the Control Panel.

1. Admin configurations users can access

With Low Variables, it’s easy to create a variable group and assign member access. Say, for example, you wanted to create a group called “General Site Configuration” and grant access to editors (and above) that would contain the Google Analytics UA ID, whether Google Analytics is on or off (which is great during development before or after launch), and limits for channel entries tags – you could do exactly that. Designated users can access this information, but may not design templates or have access to anything else you don't want them to.

2. Global site/company Information

Global content can be a tricky issue with the EE core set-up. Creating a channel is one way to solve the problem, but it often creates far too many complications and unnecessary explanations for clients. With Low Variables you can create another group that contains the company or client name, address, phone number, etc. –  all in a place the client can easily find and edit.

3. Adding forms to entries

Low also has a Low Freeform Field add-on that when combined with Low Variables or Matrix will allow you to build (Freeform) forms on a per-page basis. No more hard-coded forms that the client cannot modify.

A list of compatible field-types can be found here.

4. Nesting entries tags

Generally, nesting tags is bad form and can cause your performance to lag. But imagine if you could parse nested tags at different stages.  Interested? It’s possible to use Low Variables parsed early to parse entries and module tags, with the Variable inside other tags at the template level. This method can be used in combination with {if no_results}.

5. Adding featured content

Featured content can sometimes be tricky in EE, especially when considering performance. Often featured content is rolled into a channel somehow, but it can add quite a few additional queries during parsing. By creating a separate variables group and pulling content directly, you can then use Low Variables tags to call that content directly, simplifying both the content addition and parsing processes.

How do you use Low Variables?

Expression Engine use is all about creativity, and the possibilities with add-ons like Low Variables are nearly endless. Have more creative uses for Low Variables? Let us know!

Mike Wenger

Mike Wenger

Front-end Developer and Designer

Mike Wenger is a front-end designer and developer at Q Digital Studio. Mike’s background is in Visual Communications, and his creative roots run deep. A transplant from Ohio, Mike enjoys all the great outdoors that Colorado has to offer. While out and about, Mike can be found kayaking, cycling, backpacking and hiking – and spending time with his wife, Nicole, and their two dogs.