I've been tasked by my work to build a CMS using Umbraco, but I'm stuck. I would like to use variables which can be updated within the CMS, more specifically, I'm looking to build a monthly fee variable.
Let's say we have a monthly fee variable of say, £10. I would be looking to use this variable on as many pages as I want. However, if that monthly fee were to change to £15 in a year's time I would like to change it just once and thereby updating all instances where the variable is being used (instead of changing every single instance manually).
My question is simply, how do I achieve this? Should I be looking at using the Dictionary/Macro plugins? Or something else entirely? Is this even possible?
I guess it depends on your use case, but there are a few approaches you can take that depend a bit on how you are building your sites.
For example, you could have a settings tab on your home node that stores site wide settings.
Alternatively, you could have a structure where your root node is purely site settings, and your home node is a page beneath this point.
Another option is storing this sort of value in Web Config (although it's harder to edit this via the CMS as it would cause the site to restart.
Finally, a 4th option is to use a custom database table to store this sort of value in and have a custom Umbraco section/dashboard to manage these site settings.
That's just a couple of options off of the top of my head :-)
Global Variables
Hi,
I've been tasked by my work to build a CMS using Umbraco, but I'm stuck. I would like to use variables which can be updated within the CMS, more specifically, I'm looking to build a monthly fee variable.
Let's say we have a monthly fee variable of say, £10. I would be looking to use this variable on as many pages as I want. However, if that monthly fee were to change to £15 in a year's time I would like to change it just once and thereby updating all instances where the variable is being used (instead of changing every single instance manually).
My question is simply, how do I achieve this? Should I be looking at using the Dictionary/Macro plugins? Or something else entirely? Is this even possible?
Help would be greatly appreciated!
Cheers.
Hi Elliot,
I guess it depends on your use case, but there are a few approaches you can take that depend a bit on how you are building your sites.
For example, you could have a settings tab on your home node that stores site wide settings.
Alternatively, you could have a structure where your root node is purely site settings, and your home node is a page beneath this point.
Another option is storing this sort of value in Web Config (although it's harder to edit this via the CMS as it would cause the site to restart.
Finally, a 4th option is to use a custom database table to store this sort of value in and have a custom Umbraco section/dashboard to manage these site settings.
That's just a couple of options off of the top of my head :-)
Nik
Thanks for the swift reply! I'll give these a go when I'm back at work on Monday. Much appreciated :)
is working on a reply...