GS Custom Settings is a plugin for GetSimple CMS which lets webmasters/ site managers, theme and plugin developers implement and use their own custom settings for output, configuration, and cross-plugin/-theme communication. It allows in one package to achieve the same as Custom fields (but site-wide instead of per page), Slogans, Theme Settings, Links Manager, Custom Title and Translate combined and more. The plugin offers 8 different types of input to choose from, 3 access levels, per-user editing permission, and an easy UI to create, import and export the settings. GS Custom Settings is built on Knockout JS and uses JSON for data storage.
Features
You can download this plugin in the Extend repository.
To install, simply extract the ZIP file to the plugins directory, and activate it in the Plugins tab. A new tab 'Site' will appear in which you can use the plugin.
Basic usage
After you activate the plugin in the 'Plugins' tab, a custom 'Site' tab will show up.
Here, go to 'Edit' mode to start building your settings
NB: You always need to click 'Save updates' to confirm saving any action.
To get a setting in a page (in the WYSIWYG editor), simply type (% setting: tab/setting %).
To output a setting in PHP, type <?php get_setting('tab','setting') ?>.
To return a setting in PHP, type <?php return_setting('tab', 'setting') ?>.
Compatibility
Manage Mode:
Edit Mode:
Tutorials
Tutorial - Building a theme with GS custom settings
Theme development with GS custom Settings
Documentation
To read the full guide, go to the plugin's page.
Changelog
Features
- Custom settings for site managers, plugin and theme developers
- 9 different setting types (select, radio, text, textarea, checkbox, color, image, date, section titles) + 3 fancy variants (FontAwesome)
- 3 access levels for settings (normal, hidden, locked)
- I18n text/ textarea settings (with I18N plugin 2.5.8+)
- Output settings in pages with `(% setting:tab/setting %)` or in PHP with the rich API (see docs)
- Restrict user editing permission per user (also with MultiUser 1.8.2+)
- Feature-rich editing in 'edit' mode with multiselect, batch setting adding/removing & keyboard shortcuts
- Responsive feedback through notifications
- Import (IE10+ & other browsers)/ Export settings for re-use through the GUI
- Build and export settings directly through the UI for your plugin/ theme
- Extend existing themes and plugins with custom settings
- Access settings from other themes and plugins
- (almost) fully i18n, even custom theme and plugin settings I18n-enabled
- Available in English, French, German, Russian, Dutch & Spanish
You can download this plugin in the Extend repository.
To install, simply extract the ZIP file to the plugins directory, and activate it in the Plugins tab. A new tab 'Site' will appear in which you can use the plugin.
Basic usage
After you activate the plugin in the 'Plugins' tab, a custom 'Site' tab will show up.
Here, go to 'Edit' mode to start building your settings
NB: You always need to click 'Save updates' to confirm saving any action.
To get a setting in a page (in the WYSIWYG editor), simply type (% setting: tab/setting %).
To output a setting in PHP, type <?php get_setting('tab','setting') ?>.
To return a setting in PHP, type <?php return_setting('tab', 'setting') ?>.
Compatibility
- GS compatibility: Compatible and tested with GS 3.2.3, 3.3 & 3.4 (probably works on 3.5 too)
- PHP compatibility: Compatible and tested with PHP 5.2.1+ (might be compatible with earlier versions)
- Browser compatibility: Compatible and tested with Google Chrome, Mozilla Firefox, Internet Explorer 9+ (in IE8, only Manage mode works). Should be compatible with Safari too.
Manage Mode:
Edit Mode:
Tutorials
Tutorial - Building a theme with GS custom settings
Theme development with GS custom Settings
Documentation
To read the full guide, go to the plugin's page.
- Introduction
- Features
- Download, install, upgrade
- User guide
- For webmasters/ site managers
- For theme developers
- For plugin developers
- PHP API
- Plugin info
Code:
20/05/2015 - V. 0.4 (DevChills)
- Using cyrillic chars in the plugin will cause an error which disables saving updates.
- Content filter (% %) doesn't work anymore
- Cyrillic chars are stripped out of setting lookups
- 'Search..' label not translated
- Code copy lookup tooltip in Edit mode + sidebar tooltip for label/lookup toggle are incorrect
- Update notification & plugin version are wrong
- Last setting in a tab can't be removed
- Theme import not working (+not working for I18N-settings)
17/04/2015 - V. 0.3 (Critical fix)
- Moving the before-last tab down in Edit mode may cause a fatal error
- get_setting always returns NULL when third parameter set to false
- get_setting with image settings with whitespace in the path name are broken
- Image setting returns broken image if link is not set (now empty string)
- Color setting saves empty 'options' property
- return_setting returns an entire tab when setting isn't found (now NULL)
- notifications don't appear above sidebar when sidebar is set to sticky in gsconfig
- Tab labels can only contain ASCII Latin characters (eg, no Arab/ Russian), see http://unicode-table.com/
- Changing the 'lookup' property of a setting results in non-blocking JS errors.
- 'Section Title' & empty image input placeholder is not translated
- Edit mode multiselection bugs in IE8
- Plugin breaks when GSADMIN is set to something else than 'admin'
30/03/2015 - V. 0.2 (beta)
- 'custom-settings-init' hook not working reliably
- Tab labels can only contain ASCII Latin characters (eg, no Arab/ Russian), see http://unicode-table.com/
- FATAL: When no settings or tabs are present on first load, a fatal JS error blocks the plugin from loading
- When restricting permission, Export & Import are also unavailable.
- Empty text value settings are reset on first save if value is empty
- 'Section Title' is not translated
- Edit mode multiselection bugs in IE8
- KO site settings showing as title when no 'site' tabs are created instead of 'GS Custom Settings'
- Settings import only works with IE10 & up
- When repeatedly batch editing settings, selection might bug or actions might not be executed on entire selection
- Repeatedly importing settings for the same tab without reloading the page/ importing settings for another tab first doesn't work
- Minor JS 'input focus' error (non-blocking)
- Security token sent along with data
- return_setting returns entire setting when asked for absent property (now returns NULL)
- return_setting returns entire setting for option inputs instead of value only when value is index 0
Changelog
Code:
04/10/2015 - V. 0.6 (JS Renaissance)
New:
- Smoother mode & tab transitions, setting creation
- New, clean code base using RequireJS & Knockout components
- Lookup naming conflict errors now point the user to the involved tabs/settings
- Edit grid and sidebar colors now fully adapt to admin.xml & GS defaults
- Edit mode: Added Ctrl + A keyboard shortcut to select all settings
- Image settings can now make use of an image browser by clicking the 'Browse' button
- Color settings can now make use of a color picker by clicking the color box (except IE)
- Added date settings with datepicker
- (almost) fully compatible with FlatBlue Admin Theme plugin
Changes:
- Setting limit per tab increased from 64 to 100
- Search is now reset when changing tabs/ mode
- Enhanced performance for tab editing/ switching, search, manage-mode
- KnockoutJS dependency updated to 3.3.0 latest build (12/08/15)
- Enhanced setting code snippet display (through notification)
- Edit mode: Support for IE8 dropped
- Edit mode: Enhanced GSSTYLE_WIDE display in Edit mode
- Edit mode: Pressing SHIFT now properly toggles between the visible setting fields
- Edit mode: Icon radio/checkbox are now subtypes of radio & checkbox type settings
- Edit mode: Tab with 15+ settings are now loaded gradually to avoid page blocking in slower browsers
Bugfixes:
- Fixed all minor multi-selection bugs in Edit mode
- Fixed potential export bugs: filename for older browsers & appropriate encoding for non-ANSI chars
07/09/2015 - V 0.5.1 (Bugfix)
New:
- Added 'Save settings' button to top navigation
Bugfixes:
- Fixed setting folding automatically when type was changed
- Fixed default language en_US when GS lang is not available for plugin
25/05/2015 - V. 0.5 (Cyrillic)
New:
- Added option to disable display of lookup code copy in Manage mode for plugins/ themes
Changes:
- More space & textarea resize for settings in Edit mode
- Minor CSS changes & CSS file restructured
- Labels in Manage mode have a title attribute which displays their (full) lookup properties
- Code copy fields only appear in Manage mode when hovering over the setting
- Added server cache refresh on plugin update
Bugfixes:
- Fixed Cyrillic char problem with custom JSON indentation function
- Fixed Cyrillic chars being stripped out of setting lookups
- Fixed 'Search..' label not translated
- Fixed code copy lookup tooltip in Edit mode + sidebar tooltip for label/lookup toggle
- Fixed wrong version in plugin registration
- Fixed unable to remove the last setting in a tab
- Fixed crappy page display on load
- Fixed content filter
- Fixed theme import not working (+not working for I18N-settings)
20/05/2015 - V. 0.4 (DevChills)
New:
- 3 new plugin hooks 'custom-settings-save', 'custom-settings-render-top', and 'custom-settings-render-bottom'
- Plugin version notification & download through the UI
- Fully automatic version update of settings for themes/ plugins
- Added '?' help tab with version info, links, & translator credits
- Text & textarea settings can now be multilingual (with I18n plugin v.2.5.8+)
- Added PHP function get_i18n_setting() for multilingual settings (with I18n plugin)
- Added PHP function return_setting_group()
- It is now possible to store custom setting properties in JSON file (for checking with PHP)
- Renewed keyboard shortcuts
- When GSSTYLESBFIXED is set, the toolbar in Edit mode will sticky to the top of the window
- Tab options: enableReset ('Reset all settings' button) & 'enableAccessAll: false' hide tabs for users without editing permission
Changed:
- Upgrade from v0.1 no longer supported - to do this, deactivate, download v0.3, activate, then install 0.4
- Search filter improved (lower & uppercase)
- Code fields now show the bare lookup as title
- Tab lookups can now be set manually from the tab toolbar (tag icon)
- If gsconfig is set to have sticky sidebar, the toolbar in Edit mode will also be sticky
- Tabs may now contain any unicode characters: use at your own risk
- Textareas are resizeable vertically in Manage mode
- return_setting($tab, $setting) now returns the value instead of full setting. To return full setting, pass FALSE as third parameter
- Export output changed minimally
Bugfixes:
- Fixed moving tab down in Edit mode causing an unrepairable bug
- Fixed get_setting always returning NULL when third parameter set to false
- Fixed get_setting with image settings to encode whitespace
- Fixed empty image setting returning broken image if link is not set (now empty string)
- Fixed empty options being saved for color setting
- Fixed return_setting returning entire tab when setting wasn't found (now NULL)
- Fixed notifications not appearing above sidebar when sidebar is set to sticky in gsconfig
- Fixed 'Section Title' input & empty value image placeholder name not being translated
- Fixed (% setting %) content filter not correctly outputting HTML tags
- Removed 2 non-blocking JS errors
15/04/2015 - V. 0.3 (Critical fix)
New:
- Multi User plugin integration (v1.8.2 onwards)
- Added image & color input fields
- Added section title fields
- Theme settings can now use the shorter tab name 'theme' instead of 'theme_settings', eg get_setting('theme','setting')
- Links in descriptions become automatically clickable in 'Manage' mode
- Added per-tab search filter for settings (lookup/ label)
- Added language German & Spanish (fourth & fifth languages, so might need revision)
Changed:
- Removed 'custom-settings-init' hook (unreliable)
- Except for import/ export/ multiselect, now fully compatible with IE8 (previously only Manage mode)
Bugfixes:
- 'KO site settings' replaced as title with 'GS Custom Settings' (in UI)
- Eliminated minor JS 'input focus' error
- Import & Export buttons now also available to users who cannot access Edit mode (backup purposes)
- Fixed (% setting: tab/setting %) (now same as get_setting instead of return_setting)
- Fixed text settings not saving when value hasn't been set
- Fixed security token being sent with data (no longer)
- Fixed return_setting returning entire setting when asked for absent property (now returns NULL)
- Fixed loose checking bug returning entire setting for option inputs instead of value only when value is 0
30/03/2015 - V. 0.2 (Beta)
New:
- Fully translatable, (almost) no hard-coded values anymore
- Github repo at http://webketje.github.io/gs-custom-settings (issue tracking)
- Complete UI overhaul, including:
- tab/setting actions moved to one toolbar to unclutter the UI
- opening a tab in edit mode is the same as in manage mode (used to be through icon)
- Settings can now be batch selected/(re)moved/added
- settings keyboard functionality (Ctrl, Shift for multiselect & Delete)
- Import & export data directly from the UI as backup/ transfer to other site.
- Export tab directly to JSON for plugin/theme dev with custom settings.
- Enhanced, translatable notification manager
- Theme developers can now register their custom settings, i18n-enabled.
- Plugin developers can now register their custom settings, i18n-enabled.
- Added security token check to AJAX filehandler.
- Added PHP API with variable caching for better performance
- Permissions can be restricted per user by adding a <ko_edit>false</ko_edit> node to the user.xml
- Added languages French, Dutch.
Changed:
- Removed the ability to view all tabs in one (performance)
- Plugin folder ko_base deleted, all contents moved into one folder
- Renamed plugin more appropriately to 'Custom settings' as the focus and intent shifted away from original design.
- Added readme.md to ZIP package with some basic instructions
- Setting lookups 'tokens' must now be set manually
- Settings in the plugin's PHP functions must now be retrieved with function($tab, $setting) instead of 'tab/setting'
Bugfixes:
- Fixed array dereferencing issues. Plugin should now be compatible with PHP 5.2+
- Fixed .htaccess for settings data. No longer accessible through browser/ HTTP requests (safer)
- Fixed 'switch' input saving empty options array
- Fixed moving a tab up or down causing settings' tab field to be changed
- Fixed plugin not loading default language in case language file is missing
- Clicking labels now automatically moves focus to the relevant inputs
- JSON data is now formatted properly when saved, both through Javascript and PHP
- Buttons in sidebar now properly disabled when unusable
18/02/2014 - V. 0.1 (Alpha)
Initial launch