Loading...
 
Skip to main content

Code Howto: Add a preference to an admin panel

See also: Create a new preference

You simply need to use the preference smarty pluginQuestion in one of the administration panel templates (templates/admin/include_*.tplQuestion).

Sample inclusion
Copy to clipboard
{preference name=example_my_pref_name}

How to hide options with dependencies


Just add id="feature_xyz_childcontainer" where feature_xyz is the name of the parent features. So if parent feature is off...

For a radio field use id="fgal_use_db_childcontainer_1" for the first radio button, id="fgal_use_db_childcontainer_2" for the second radio button ...

Copy to clipboard
<div class="adminoptionboxchild" id="feature_multilingual_childcontainer"> This text will just appear if feature_multilingual is activated </div>


To have a longer preference name in search results, yet a shorter one visible in the template:

Copy to clipboard
{preference name=some_name label="{tr}Shorter Name{/tr}"}

Preference always visible

Copy to clipboard
{preference name=feature_wiki visible="always"}


This can be useful to avoid the basic/advanced tags (filters) on certain admin panels

Templates

The templates to modify the look & feel of the preferences:
http://sourceforge.net/p/tikiwiki/code/HEAD/tree/trunk/templates/prefs/Question

alias
Show PHP error messages