0

I need to store a single numerical value in the admin for use in my templates. What is the best way to do this. I've reviewed Accessories, Extensions and Modules but can't seem to find something that has the simplicity of setting up the admin area and the ease of using it on the front end template.

4
  • 1
    try a global variable or a snippet
    – Jim Wyse
    Apr 3 '17 at 14:46
  • @JimWyse can you point me to some documentation on global variables? I've been searching for how to add one to the admin but haven't found anything.
    – Fencer04
    Apr 3 '17 at 14:48
  • 1
    It called "Template Partials" in EE3. Go to "Developer > Template manager". at bottom left sidebar you will find it. Go to "Template Partials" and create one. you can direct use it in front end templates with the name of partial you create. for an example if you name partial "abc" you can use {abc} in front end template to view its value. Apr 3 '17 at 14:57
  • @Mufi I'm using EE 2.11.7. Is it still available there?
    – Fencer04
    Apr 3 '17 at 14:59
1

Set up a Global Variable with the value you need. Then you can access the value from within a template simply by including the Global Variable name (within curly brackets) within your templates - e.g. {global_variable_name}

In EE2, Global Variables are set via the Control Panel - go to Design / Templates / Global Variables to do this. More info here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.