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
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 :)
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 :)
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.
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.
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
Do i really need a whole package for just one global variable?
Sounds like a lot of work for just one field
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.
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.
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.
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.
I'm not sure, but this addon may help you:
http://www.concrete5.org/marketplace/addons/tokens/...
http://www.concrete5.org/marketplace/addons/tokens/...
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 :)
thanks for everyones replies :)
http://www.concrete5.org/community/forums/customizing_c5/global-val...