Difference between revisions of "Configuration Options"
From Tweeki
(66 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | Here you can find all options (and their defaults) that can be set in '''LocalSettings.php''' (after the inclusion of | + | Here you can find all options (and their defaults) that can be set in '''LocalSettings.php''' (after the inclusion of Tweeki.php): |
== Page Layout == | == Page Layout == | ||
+ | |||
+ | === Custom Page Renderer === | ||
$wgTweekiSkinPageRenderer = 'self::renderPage'; | $wgTweekiSkinPageRenderer = 'self::renderPage'; | ||
− | :Use this variable to change the default page layout. Replace the value with the name of a custom function - use <code>TweekiTemplate::renderPage()</code> as a template to build your own layout. | + | |
+ | :Use this variable to change the default page layout. Replace the value with the name of a custom function - use <code>TweekiTemplate::renderPage()</code> in [https://github.com/thaider/Tweeki/blob/master/includes/TweekiTemplate.php#L96 includes/TweekiTemplate.php] as a template to build your own layout. | ||
+ | |||
+ | $wgTweekiSkinPageRenderer = 'myPageRenderer'; | ||
+ | |||
+ | function myPageRenderer( $skin ) { ... } | ||
+ | |||
+ | === Custom Navbar Renderer === | ||
+ | |||
+ | $wgTweekiSkinNavbarRenderer = 'self::renderNavbar'; | ||
+ | |||
+ | :Use this variable to change the layout of the navbar. Replace the value with the name of a custom function - use <code>TweekiTemplate::renderNavbar()</code> in [https://github.com/thaider/Tweeki/blob/master/includes/TweekiTemplate.php#L96 includes/TweekiTemplate.php] as a template to build your own navbar layout. | ||
+ | |||
+ | $wgTweekiSkinNavbarRenderer = 'myNavbarRenderer'; | ||
+ | |||
+ | function myNavbarRenderer( $skin ) { ... } | ||
+ | |||
+ | === Costum Bootstrap Files === | ||
+ | |||
+ | $wgTweekiSkinCustomizedBootstrap = [ | ||
+ | 'localBasePath' => __DIR__, | ||
+ | 'remoteExtPath' => 'MyExtension' | ||
+ | ]; | ||
+ | |||
+ | :Use this in your own extension to use your own customized bootstrap files. For details see this [[How-Tos#Completely_replace_bootstrap_files_with_customized_versions|How-To]]. | ||
+ | |||
+ | === Custom CSS === | ||
+ | |||
+ | $wgTweekiSkinCustomCSS = []; | ||
+ | |||
+ | :Add ''Resource Modules'' to this array. For details see this [[How-Tos#Add custom CSS|How-To]]. | ||
+ | |||
+ | === Additional Body Classes === | ||
+ | |||
+ | $wgTweekiSkinAdditionalBodyClasses = array(); | ||
+ | |||
+ | :Add your custom body classes. You can use the <code><nowiki>{{#tweekibodyclasses}}</nowiki></code> parser function to add classes per page or via a template call. And you can also use the <code>SkinTweekiAdditionalBodyClasses</code> hook. | ||
+ | |||
+ | === Togglable Tabs On File Pages === | ||
+ | |||
+ | $wgTweekiSkinImagePageTOCTabs = false; | ||
+ | |||
+ | :Set to true, if you want file pages to be rendered as [[Tabs|togglable tabs]]. | ||
+ | |||
+ | === Grids === | ||
+ | |||
+ | The widths and offsets for the main content and the sidebars can be adjusted, depending on how many sidebars (if any) are shown on a particular page: | ||
+ | |||
+ | ==== No sidebars ==== | ||
+ | <div class="container-fluid gridexample"><div class="row"> | ||
+ | <div class="col-sm-offset-1 col-sm-10 content">main content</div> | ||
+ | </div></div> | ||
+ | |||
+ | $wgTweekiSkinGridNone = [ | ||
+ | "mainoffset" => 1, | ||
+ | "mainwidth" => 10 | ||
+ | ]; | ||
+ | |||
+ | :Offset and width for the main content if no sidebars are shown. | ||
+ | |||
+ | ==== Left Sidebar ==== | ||
+ | |||
+ | <div class="container-fluid gridexample"><div class="row"> | ||
+ | <div class="col-sm-3 content">left sidebar</div> | ||
+ | <div class="col-sm-9 content">main content</div> | ||
+ | </div></div> | ||
+ | |||
+ | $wgTweekiSkinGridLeft = [ | ||
+ | "leftoffset" => 0, | ||
+ | "leftwidth" => 3, | ||
+ | "mainoffset" => 0, | ||
+ | "mainwidth" => 9 | ||
+ | ]; | ||
+ | |||
+ | :Offsets and widths for the left sidebar and the main content. | ||
+ | |||
+ | ==== Right Sidebar ==== | ||
+ | |||
+ | <div class="container-fluid gridexample"><div class="row"> | ||
+ | <div class="col-sm-9 content">main content</div> | ||
+ | <div class="col-sm-3 content">right sidebar</div> | ||
+ | </div></div> | ||
+ | |||
+ | $wgTweekiSkinGridRight = [ | ||
+ | "mainoffset" => 0, | ||
+ | "mainwidth" => 9, | ||
+ | "rightoffset" => 0, | ||
+ | "rightwidth" => 3 | ||
+ | ]; | ||
+ | |||
+ | :Offsets and widths for the main content and the right sidebar. | ||
+ | |||
+ | ==== Sidebars On Both Sides ==== | ||
+ | |||
+ | <div class="container-fluid gridexample"><div class="row"> | ||
+ | <div class="col-sm-2 content">left sidebar</div> | ||
+ | <div class="col-sm-8 content">main content</div> | ||
+ | <div class="col-sm-2 content">right sidebar</div> | ||
+ | </div></div> | ||
+ | |||
+ | $wgTweekiSkinGridBoth = [ | ||
+ | "leftoffset" => 0, | ||
+ | "leftwidth" => 2, | ||
+ | "mainoffset" => 0, | ||
+ | "mainwidth" => 8, | ||
+ | "rightoffset" => 0, | ||
+ | "rightwidth" => 2 | ||
+ | ]; | ||
+ | |||
+ | :Offsets and widths for the left sidebar, the main content and the right sidebar. | ||
== Navigation == | == Navigation == | ||
Line 12: | Line 123: | ||
==== Navigational Elements ==== | ==== Navigational Elements ==== | ||
− | $wgTweekiSkinNavigationalElements = | + | $wgTweekiSkinNavigationalElements = []; |
:Add to this array to create '''customized buttons''', the array's key is the keyword for the navigational element to be used in navbars, subnav, sidebar, or footer, the value is the name of a callback function. This function will be called with the skin object as argument and should return either an array of buttons or a string that can be parsed as buttons. | :Add to this array to create '''customized buttons''', the array's key is the keyword for the navigational element to be used in navbars, subnav, sidebar, or footer, the value is the name of a callback function. This function will be called with the skin object as argument and should return either an array of buttons or a string that can be parsed as buttons. | ||
==== Special Elements ==== | ==== Special Elements ==== | ||
− | $wgTweekiSkinSpecialElements = | + | $wgTweekiSkinSpecialElements = [ |
'FIRSTHEADING' => 'self::renderFirstHeading', | 'FIRSTHEADING' => 'self::renderFirstHeading', | ||
'TOC' => 'self::renderTOC', | 'TOC' => 'self::renderTOC', | ||
Line 23: | Line 134: | ||
'LOGO' => 'self::renderLogo', | 'LOGO' => 'self::renderLogo', | ||
'LOGIN-EXT' => 'self::renderLoginExt' | 'LOGIN-EXT' => 'self::renderLoginExt' | ||
− | + | ]; | |
− | :Use this array to add '''completely arbitrary code''' into navbars, subnav, sidebar, or footer. The value again is a callback function you need to create. It will be called with two arguments, the skin object and the context as a string (navbar-left, navbar-right, subnav, sidebar, footer). The function should directly print the html you want to have. | + | :Use this array to add '''completely arbitrary code''' into navbars, subnav, sidebar, or footer. The value again is a callback function you need to create. It will be called with two arguments, the skin object and the context as a string (navbar-left, navbar-right, subnav, sidebar, footer). The function should directly print the html you want to have. See [[How-Tos#Show_a_text_block_in_a_navigational_section|this How-To]] for an example of how to use it. |
Line 31: | Line 142: | ||
=== Hiding Page Elements === | === Hiding Page Elements === | ||
− | $wgTweekiSkinHideAll = | + | $wgTweekiSkinHideAll = [ 'footer-info' => true ]; |
− | :This variable can be used to hide elements from everybody. The [[#Tweekihide parser function|<nowiki>{{#tweekihide}}</nowiki> parser function]] will add to this array. Attention: Only hiding of elements that are also listed in <nowiki>$wgTweekiSkinHideable</nowiki> will actually be put into effect. | + | :This variable can be used to hide elements from everybody. The [[Parser Functions#Tweekihide parser function|<nowiki>{{#tweekihide}}</nowiki> parser function]] will add to this array. Attention: Only hiding of elements that are also listed in <nowiki>$wgTweekiSkinHideable</nowiki> will actually be put into effect. |
+ | |||
+ | $wgTweekiSkinHideable = [ 'firstHeading' ]; | ||
+ | :In order to prevent abuse, only elements listed in this array are allowed to be hidden by the [[Parser Functions#Tweekihide parser function|<nowiki>{{#tweekihide}}</nowiki> parser function]]. Add new elements with <code>$wgTweekiSkinHideable[] = 'subnav';</code>. | ||
− | $ | + | $wgTweekiSkinHideAnon = [ 'subnav' => true, 'PERSONAL' => true, 'TOOLBOX' => true ]; |
− | : | + | :Elements in this array will be hidden for users who are NOT logged in. |
− | $ | + | $wgTweekiSkinHideLoggedin = [ 'footer-custom' => true ]; |
− | :Elements in this array will be hidden for users who | + | :Elements in this array will be hidden for users who ARE logged in. |
− | $ | + | $wgTweekiSkinHideNonAdvanced = [ 'EDIT-EXT-special' => true ]; |
− | :Elements in this array will only be shown to users who have chosen in their preferences to | + | :Elements in this array will only be shown to users who have chosen in their preferences to show "advanced features". |
+ | |||
+ | $wgTweekiSkinHideExcept | ||
+ | :Use this to hide an element for everybody except those belonging to any of the groups specified. Usage: <code>$wgTweekiSkinHideExcept[ELEMENT] = [GROUPS];</code>, e.g. <code>$wgTweekiSkinHideExcept['sidebar-right'] = ['sysop'];</code> to show the right sidebar only to sysops (i.e. administrators) | ||
=== Footer === | === Footer === | ||
− | $wgTweekiSkinFooterIcons = | + | $wgTweekiSkinFooterIcons = false; |
:If set to false, the icons in the footer will be replaced by text aquivalents. | :If set to false, the icons in the footer will be replaced by text aquivalents. | ||
== Miscellaneous == | == Miscellaneous == | ||
+ | |||
+ | ==== Button Parsing ==== | ||
+ | |||
+ | $wgTweekiSkinUseBtnParser = true; | ||
+ | :Whether or not to parse the <code><nowiki><btn></nowiki></code>-Tag (see [[Buttons]]). | ||
==== Font Awesome ==== | ==== Font Awesome ==== | ||
Line 54: | Line 176: | ||
$wgTweekiSkinUseAwesome = true; | $wgTweekiSkinUseAwesome = true; | ||
:Whether or not to include [http://fortawesome.github.io/Font-Awesome/ Font Awesome] to allow the use of icons like this one: <span class="fa fa-bus"></span> (<code><nowiki><span class="fa fa-bus"></span></nowiki></code>) | :Whether or not to include [http://fortawesome.github.io/Font-Awesome/ Font Awesome] to allow the use of icons like this one: <span class="fa fa-bus"></span> (<code><nowiki><span class="fa fa-bus"></span></nowiki></code>) | ||
+ | |||
+ | ==== Bootstrap Theme ==== | ||
+ | |||
+ | $wgTweekiSkinUseBootstrapTheme = true; | ||
+ | :Whether or not to include the code for Bootstrap's theme (enhanced styling for buttons etc.). | ||
+ | |||
+ | ==== Tooltips ==== | ||
+ | |||
+ | $wgTweekiSkinUseTooltips = false; | ||
+ | :Whether or not to use Bootstrap's [http://getbootstrap.com/javascript/#tooltips tooltips] for buttons using the <code>data-toggle="tooltip"</code> attribute. | ||
+ | |||
+ | ==== Costum Edit Section Links ==== | ||
+ | |||
+ | $wgTweekiSkinCustomEditSectionLink = true; | ||
+ | :Whether or not to use customized edit section links. If true you can specify an icon, the text and css classes for the edit links placed next to section headings. | ||
+ | |||
+ | ==== Use Star Icon for Watchlist ==== | ||
+ | |||
+ | $wgTweekiSkinUseIconWatch = false; | ||
+ | :Watch and unwatch as an icon rather than a link. | ||
+ | |||
+ | ==== Use Real Names for Users ==== | ||
+ | |||
+ | $wgTweekiSkinUseRealnames = false; | ||
+ | :When displaying links to user pages, use their real name if they provide one instead of the user name. | ||
+ | |||
+ | ==== Use user images instead of icon ==== | ||
+ | |||
+ | $wgTweekiSkinUserImageProperty = false; | ||
+ | :Instead of the generic user icon, use an user image, if one has been uploaded. Works only together with the [https://www.semantic-mediawiki.org Semantic MediaWiki] extension. Set the configuration option to the name of a property of user pages holding the name of the File that should be used. |
Latest revision as of 12:00, 30 December 2021
Here you can find all options (and their defaults) that can be set in LocalSettings.php (after the inclusion of Tweeki.php):
Page Layout
Custom Page Renderer
$wgTweekiSkinPageRenderer = 'self::renderPage';
- Use this variable to change the default page layout. Replace the value with the name of a custom function - use
TweekiTemplate::renderPage()
in includes/TweekiTemplate.php as a template to build your own layout.
$wgTweekiSkinPageRenderer = 'myPageRenderer'; function myPageRenderer( $skin ) { ... }
$wgTweekiSkinNavbarRenderer = 'self::renderNavbar';
- Use this variable to change the layout of the navbar. Replace the value with the name of a custom function - use
TweekiTemplate::renderNavbar()
in includes/TweekiTemplate.php as a template to build your own navbar layout.
$wgTweekiSkinNavbarRenderer = 'myNavbarRenderer'; function myNavbarRenderer( $skin ) { ... }
Costum Bootstrap Files
$wgTweekiSkinCustomizedBootstrap = [ 'localBasePath' => __DIR__, 'remoteExtPath' => 'MyExtension' ];
- Use this in your own extension to use your own customized bootstrap files. For details see this How-To.
Custom CSS
$wgTweekiSkinCustomCSS = [];
- Add Resource Modules to this array. For details see this How-To.
Additional Body Classes
$wgTweekiSkinAdditionalBodyClasses = array();
- Add your custom body classes. You can use the
{{#tweekibodyclasses}}
parser function to add classes per page or via a template call. And you can also use theSkinTweekiAdditionalBodyClasses
hook.
Togglable Tabs On File Pages
$wgTweekiSkinImagePageTOCTabs = false;
- Set to true, if you want file pages to be rendered as togglable tabs.
Grids
The widths and offsets for the main content and the sidebars can be adjusted, depending on how many sidebars (if any) are shown on a particular page:
No sidebars
main content
$wgTweekiSkinGridNone = [ "mainoffset" => 1, "mainwidth" => 10 ];
- Offset and width for the main content if no sidebars are shown.
Left Sidebar
left sidebar
main content
$wgTweekiSkinGridLeft = [ "leftoffset" => 0, "leftwidth" => 3, "mainoffset" => 0, "mainwidth" => 9 ];
- Offsets and widths for the left sidebar and the main content.
Right Sidebar
main content
right sidebar
$wgTweekiSkinGridRight = [ "mainoffset" => 0, "mainwidth" => 9, "rightoffset" => 0, "rightwidth" => 3 ];
- Offsets and widths for the main content and the right sidebar.
Sidebars On Both Sides
left sidebar
main content
right sidebar
$wgTweekiSkinGridBoth = [ "leftoffset" => 0, "leftwidth" => 2, "mainoffset" => 0, "mainwidth" => 8, "rightoffset" => 0, "rightwidth" => 2 ];
- Offsets and widths for the left sidebar, the main content and the right sidebar.
$wgTweekiSkinNavigationalElements = [];
- Add to this array to create customized buttons, the array's key is the keyword for the navigational element to be used in navbars, subnav, sidebar, or footer, the value is the name of a callback function. This function will be called with the skin object as argument and should return either an array of buttons or a string that can be parsed as buttons.
Special Elements
$wgTweekiSkinSpecialElements = [ 'FIRSTHEADING' => 'self::renderFirstHeading', 'TOC' => 'self::renderTOC', 'SEARCH' => 'self::renderSearch', 'LOGO' => 'self::renderLogo', 'LOGIN-EXT' => 'self::renderLoginExt' ];
- Use this array to add completely arbitrary code into navbars, subnav, sidebar, or footer. The value again is a callback function you need to create. It will be called with two arguments, the skin object and the context as a string (navbar-left, navbar-right, subnav, sidebar, footer). The function should directly print the html you want to have. See this How-To for an example of how to use it.
Note that you can use both functions to overwrite the default output!
Hiding Page Elements
$wgTweekiSkinHideAll = [ 'footer-info' => true ];
- This variable can be used to hide elements from everybody. The {{#tweekihide}} parser function will add to this array. Attention: Only hiding of elements that are also listed in $wgTweekiSkinHideable will actually be put into effect.
$wgTweekiSkinHideable = [ 'firstHeading' ];
- In order to prevent abuse, only elements listed in this array are allowed to be hidden by the {{#tweekihide}} parser function. Add new elements with
$wgTweekiSkinHideable[] = 'subnav';
.
$wgTweekiSkinHideAnon = [ 'subnav' => true, 'PERSONAL' => true, 'TOOLBOX' => true ];
- Elements in this array will be hidden for users who are NOT logged in.
$wgTweekiSkinHideLoggedin = [ 'footer-custom' => true ];
- Elements in this array will be hidden for users who ARE logged in.
$wgTweekiSkinHideNonAdvanced = [ 'EDIT-EXT-special' => true ];
- Elements in this array will only be shown to users who have chosen in their preferences to show "advanced features".
$wgTweekiSkinHideExcept
- Use this to hide an element for everybody except those belonging to any of the groups specified. Usage:
$wgTweekiSkinHideExcept[ELEMENT] = [GROUPS];
, e.g.$wgTweekiSkinHideExcept['sidebar-right'] = ['sysop'];
to show the right sidebar only to sysops (i.e. administrators)
$wgTweekiSkinFooterIcons = false;
- If set to false, the icons in the footer will be replaced by text aquivalents.
Miscellaneous
Button Parsing
$wgTweekiSkinUseBtnParser = true;
- Whether or not to parse the
<btn>
-Tag (see Buttons).
Font Awesome
$wgTweekiSkinUseAwesome = true;
- Whether or not to include Font Awesome to allow the use of icons like this one: (
<span class="fa fa-bus"></span>
)
Bootstrap Theme
$wgTweekiSkinUseBootstrapTheme = true;
- Whether or not to include the code for Bootstrap's theme (enhanced styling for buttons etc.).
Tooltips
$wgTweekiSkinUseTooltips = false;
- Whether or not to use Bootstrap's tooltips for buttons using the
data-toggle="tooltip"
attribute.
Costum Edit Section Links
$wgTweekiSkinCustomEditSectionLink = true;
- Whether or not to use customized edit section links. If true you can specify an icon, the text and css classes for the edit links placed next to section headings.
Use Star Icon for Watchlist
$wgTweekiSkinUseIconWatch = false;
- Watch and unwatch as an icon rather than a link.
Use Real Names for Users
$wgTweekiSkinUseRealnames = false;
- When displaying links to user pages, use their real name if they provide one instead of the user name.
Use user images instead of icon
$wgTweekiSkinUserImageProperty = false;
- Instead of the generic user icon, use an user image, if one has been uploaded. Works only together with the Semantic MediaWiki extension. Set the configuration option to the name of a property of user pages holding the name of the File that should be used.