Page 1 of 1

How to Add Settings

Posted: Tue Jan 06, 2009 3:21 am
by sfj
Whats the best way add system wide settings.

For example, we are adding a new type of image, (instead of icon, thumbnail, and standard) we are adding type 'large'

The width and height, I would like placed somewhere in the control panel, how later can I access it?

(Without modifying the source code, meaning the framework)

Right now it is hard coded...

SFJ

Re: How to Add Settings

Posted: Tue Jan 06, 2009 4:30 am
by mazhar
Whats the best way add system wide settings.
You can create a store setting for this purpose. Look the code posted here for store settings page. It will provide you a good sample to start with.
viewtopic.php?f=42&t=8835
The store setting page is updated to incorporate a new bool type system wide setting that will flag an address setting.

You can add or update some setting in store settings as below

Code: Select all

Token.Instance.Store.Settings.SetValueByKey("setting_name", "your value");
You can get a setting value out as below

Code: Select all

string settingValue = Token.Instance.Store.Settings.GetValueByKey("setting_name");