Site preferences (v2)
12 April 2022 550 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. Your setter method should include appropriate validation rules.
- Add a row for your new preference to the form trust_path/libraries/tuskfish/form/preferenceEdit.html, so that you can 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.