Site preferences (v2)
12 April 2022 985 views | Documentation v2
Accessing preferences
Site preferences are available in model and viewModel classes for each route via the preference property, and are accessible via a call such as:
$this->preference->siteName();
Editing preferences
Tuskfish preferences are edited via the Preferences link in the admin section of your site. The function of each preference is described in the User Manual.
Adding new preferences
You can add additional preferences to Tuskfish fairly easily. All you need to do is to:
- Add another row to the preference table of your database (use DB Browser for SQLite or phpLiteAdmin), with an appropriate data type and default value.
- Add the new preference as a property to the Preference class, including getter/setter methods, and an entry in the load() method. Your setter method should include appropriate validation rules.
- Add a rows for your new preference to the form /themes/admin/preferenceEdit.html and preferenceTable.html, so that you can view and edit it from the preference page.
- Add a language constant for your new preference to trust_path/libraries/tuskfish/language/english.php or equivalent.
Copyright, all rights reserved.