Fix schedule sidebar for workshops in 2024

This commit is contained in:
Vencislav Atanasov 2024-10-10 20:23:34 +03:00
parent bbd885d3ac
commit c969dd7146
1 changed files with 17 additions and 2 deletions

View File

@ -8,8 +8,23 @@ require("schedule-config.php");
?>
<section class="content grid">
<?php
function should_show_sidebar() {
if ($year === '2021') {
return true;
}
if (preg_match('/^full/', $pagename)) {
return false;
}
if ($year === '2024' && preg_match('/^workshop/', $pagename)) {
return false;
}
return true;
}
// full schedule is not limited in only one column
if (!preg_match('/^full/', $pagename) || $year == '2021') {
if (should_show_sidebar()) {
echo '<div class="col-left">';
}
?>
@ -42,7 +57,7 @@ if (!empty($content)) {
?>
<?php
if (!preg_match('/^full/', $pagename) || $year == '2021') {
if (should_show_sidebar()) {
echo "</div>";
get_sidebar();
};