Global atrributes

Permalink
Is it possible to set an editable global attribute that is available site wide? Ie the admin edits once and it appears/is available from overrides, controllers, block views etc

alanski
 
adajad replied on at Permalink Reply
adajad
Yes it's possible. Instead of me repeating the information you can take a look at this post:

http://www.concrete5.org/community/forums/customizing_c5/global-val...
alanski replied on at Permalink Reply
alanski
THanks I guessed as much.
But I cant see from the documentation where I can make this editable easily for a site admin. I need one variable for a site that is an important financial piece of info used on donation pages.

We are popping a modal to display the info from a donation form. But what makes sense is to have the content of the modal editable globally from a site config. The documentation seems to suggest a package is one way of implementing. But I was wondering how a global config variable can edited from dashboard and reused in blocks etc.

So I can see i can programmatically set configs for storage but not sure how to make editable sensibly :)
adajad replied on at Permalink Reply
adajad
I would create a dashboard page and have the variable editable from there.

You can take a look at this package on how that can be done: http://www.concrete5.org/marketplace/addons/print-my-page/...

That package adds a dashboard page where you can set and edit global information stored in the config table.

Then you need to create the modal that gets the information from the db.
alanski replied on at Permalink Reply
alanski
Thanks for the replies.
Do i really need a whole package for just one global variable?
Sounds like a lot of work for just one field
JohntheFish replied on at Permalink Reply
JohntheFish
Also see:

http://www.concrete5.org/documentation/how-tos/developers/use-the-c...


While looking through the code of free addons is a good way to learn about building things, with a standard marketplace licence free of price does not mean free of copyright. So if you actually re-use sections of code from a free addon you should seek the developers permission first.
adajad replied on at Permalink Reply
adajad
Good point.

I was merely referencing the add-on as an example on how it can be done and not saying it is the only way to do it.
elimo replied on at Permalink Best Answer Reply
I'm not sure, but this addon may help you:
http://www.concrete5.org/marketplace/addons/tokens/...
alanski replied on at Permalink Reply
alanski
I think due to time constraints and not having enough time to roll my own the token add on is a happy solution which packs a simple punch.

thanks for everyones replies :)