Text seperators with multiple columns in yootheme templates
Working on a clients website (joomla 3) which is built on the yootheme warp framework. Needed to enable a multi column drop down menu on a text seperator.
The Yootheme documentation states you just add "columns-2" on the page class. But text separators don't give you the option to insert this (as they don't display a page, why would you need to enter a page class - makes sense)
The site looked weird without it so to achieve this we did the following:
opened and edited the templates/[TEMPLATENAME]/warp/systems/joomla/menus/pre.php
scrolled to line 49 and replaced this text
// set columns and width
if (isset($item) && strpos($item->params->get('pageclass_sfx'), 'column') !== false) {
if (preg_match('/columns-(\d+)/', $item->params->get('pageclass_sfx'), $matches)) {
$li->attr('data-menu-columns', $matches[1]);
}
if (preg_match('/columnwidth-(\d+)/', $item->params->get('pageclass_sfx'), $matches)) {
$li->attr('data-menu-columnwidth', $matches[1]);
}
}
with
// set columns and width
if (isset($item) && strpos($item->params->get('pageclass_sfx'), 'column') !== false) {
if (preg_match('/columns-(\d+)/', $item->params->get('pageclass_sfx'), $matches)) {
$li->attr('data-menu-columns', $matches[1]);
}
if (preg_match('/columnwidth-(\d+)/', $item->params->get('pageclass_sfx'), $matches)) {
$li->attr('data-menu-columnwidth', $matches[1]);
}
}
// set columns and width on text seperators
if (isset($item) && strpos($item->note, 'column') !== false) {
if (preg_match('/columns-(\d+)/', $item->note, $matches)) {
$li->attr('data-menu-columns', $matches[1]);
}
if (preg_match('/columnwidth-(\d+)/', $item->note, $matches)) {
$li->attr('data-menu-columnwidth', $matches[1]);
}
}
Now to set columns on a text separator you just need to enter columns-2
in the menu Notes
input