Skip to content

Commit

Permalink
making sidebars work, fixes #222
Browse files Browse the repository at this point in the history
  • Loading branch information
thaider committed Oct 17, 2021
1 parent cd1c906 commit 52fd4f5
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
34 changes: 34 additions & 0 deletions includes/TweekiTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,40 @@ public static function renderPage( $skin ) {
$skin->renderFooter();

} else {
// load defaults for layout without sidebar
$main_offset = $skin->getConfig( 'TweekiSkinGridNone' )['mainoffset'];
$main_width = $skin->getConfig( 'TweekiSkinGridNone' )['mainwidth'];
$left_width = 0;
$left_offset = 0;
$right_width = 0;
$right_offset = 0;
// TODO: check for situational emptiness of sidebar (e.g. on special pages)
if( true ) {
$sidebar_left = $skin->checkVisibility( 'sidebar-left' ) && !$skin->checkEmptiness( 'sidebar-left' );
$sidebar_right = $skin->checkVisibility( 'sidebar-right' ) && !$skin->checkEmptiness( 'sidebar-right' );
if( $sidebar_left && $sidebar_right ) { // both sidebars
$left_offset = $skin->getConfig( 'TweekiSkinGridBoth' )['leftoffset'];
$left_width = $skin->getConfig( 'TweekiSkinGridBoth' )['leftwidth'];
$main_offset = $skin->getConfig( 'TweekiSkinGridBoth' )['mainoffset'];
$main_width = $skin->config->get( 'TweekiSkinGridBoth' )['mainwidth'];
$right_offset = $skin->getConfig( 'TweekiSkinGridBoth' )['rightoffset'];
$right_width = $skin->getConfig( 'TweekiSkinGridBoth' )['rightwidth'];
}
if( $sidebar_left XOR $sidebar_right ) { // only one of the sidebars
if( $sidebar_left ) {
$left_offset = $skin->getConfig( 'TweekiSkinGridLeft' )['leftoffset'];
$left_width = $skin->getConfig( 'TweekiSkinGridLeft' )['leftwidth'];
$main_offset = $skin->getConfig( 'TweekiSkinGridLeft' )['mainoffset'];
$main_width = $skin->getConfig( 'TweekiSkinGridLeft' )['mainwidth'];
}
else {
$main_offset = $skin->getConfig( 'TweekiSkinGridRight' )['mainoffset'];
$main_width = $skin->getConfig( 'TweekiSkinGridRight' )['mainwidth'];
$right_offset = $skin->getConfig( 'TweekiSkinGridRight' )['rightoffset'];
$right_width = $skin->getConfig( 'TweekiSkinGridRight' )['rightwidth'];
}
}
}

$mainclass = 'col-md-' . $main_width;
if( $main_offset > 0 ) {
Expand Down
2 changes: 1 addition & 1 deletion public/default/css/tweeki.css

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions resources/styles/tweeki/_overwrites.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@
// }


@include media-breakpoint-up(md) {
#sidebar {
&-right {
order:2;
}
&-left {
order:0;
}
}
#maincontentwrapper {
order:1;
}
}

.navbar {
.form-group {
// margin-bottom: 0;
Expand Down Expand Up @@ -148,6 +162,7 @@ body {
margin-top:0;
}
}

}

// Hide default TOC in content
Expand Down

0 comments on commit 52fd4f5

Please sign in to comment.