Difference between revisions of "Configuration Options"

From Tweeki
Jump to: navigation, search
Line 33: Line 33:
  
 
=== Grids ===
 
=== Grids ===
 +
 +
<div class="container-fluid gridexample"><div class="row">
 +
<div class="col-sm-offset-1 col-sm-10 content"></div>
 +
</div></div>
  
 
  $wgTweekiSkinNoSidebarWidths = array(  
 
  $wgTweekiSkinNoSidebarWidths = array(  
   "mainoffset": 1,  
+
   "mainoffset" => 1,  
 
   "mainwidth" => 10  
 
   "mainwidth" => 10  
 
  );  
 
  );  
Line 41: Line 45:
 
:Offset and width for the main content
 
:Offset and width for the main content
  
  $wgTweekiSkinLeftSidebarWidths = array( 0, 3, 0, 9 );
+
  $wgTweekiSkinLeftSidebarWidths = array(  
 +
  "leftoffset" => 0,  
 +
  "leftwidth" => 3,  
 +
  "mainoffset" => 0,  
 +
  "mainwidth" => 9  
 +
);
  
 
:Offsets and widths for the left sidebar and the main content.
 
:Offsets and widths for the left sidebar and the main content.
  
  $wgTweekiSkinRightSidebarWidths = array( 0, 9, 0, 3 );
+
  $wgTweekiSkinRightSidebarWidths = array(  
 +
  "mainoffset" => 0,  
 +
  "mainwidth" => 9,  
 +
  "rightoffset" => 0,  
 +
  "rightwidth" => 3  
 +
);
  
 
:Offsets and widths for the main content and the right sidebar.
 
:Offsets and widths for the main content and the right sidebar.
  
  $wgTweekiSkinDoubleSidebarWidths = array( 0, 2, 0, 8, 0, 2 );
+
  $wgTweekiSkinDoubleSidebarWidths = array(  
 +
  "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.
 
:Offsets and widths for the left sidebar, the main content and the right sidebar.

Revision as of 15:55, 1 January 2017

Here you can find all options (and their defaults) that can be set in LocalSettings.php (after the inclusion of Tweeki.php):

Page Layout

$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 Tweeki.skin.php as a template to build your own layout.
$wgTweekiSkinPageRenderer = 'MyHooks::myPageRenderer';
public static function myPageRenderer( $skin ) { ... }

Costum Bootstrap Files

$wgTweekiSkinCustomizedBootstrap = array(
      '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 = array();
Add Resource Modules to this array. For details see this How-To.

Togglable Tabs On File Pages

$wgTweekiSkinImagePageTOCTabs = false;
Set to true, if you want file pages to be rendered as togglable tabs.

Grids

$wgTweekiSkinNoSidebarWidths = array( 
 "mainoffset" => 1, 
 "mainwidth" => 10 
); 
Offset and width for the main content
$wgTweekiSkinLeftSidebarWidths = array( 
 "leftoffset" => 0, 
 "leftwidth" => 3, 
 "mainoffset" => 0, 
 "mainwidth" => 9 
);
Offsets and widths for the left sidebar and the main content.
$wgTweekiSkinRightSidebarWidths = array( 
 "mainoffset" => 0, 
 "mainwidth" => 9, 
 "rightoffset" => 0, 
 "rightwidth" => 3 
);
Offsets and widths for the main content and the right sidebar.
$wgTweekiSkinDoubleSidebarWidths = array( 
 "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

Special Navigational Elements

Navigational Elements

$wgTweekiSkinNavigationalElements = array();
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 = array( 
  '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.


Note that you can use both functions to overwrite the default output!

Hiding Page Elements

$wgTweekiSkinHideAll = array();
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 = array( 'firstHeading' );
In order to prevent abuse, only elements listed in this array are allowed to be hidden by the {{#tweekihide}} parser function.
$wgTweekiSkinHideAnon = array();
Elements in this array will be hidden for users who are not logged in.
$wgTweekiSkinHideNonAdvanced = array( 'TOOLBOX', 'EDIT-EXT-special' );
Elements in this array will only be shown to users who have chosen in their preferences to show "advanced features".

Footer

$wgTweekiSkinFooterIcons = true;
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.