Text seperators with multiple columns in yootheme templates

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

You may be interested in...



Had enough browsing?

Get in touch

Get in touch

We wont charge you for the inital project meeting. So really you have nothing to lose.

Fill out the form below with as much information as you can provide and we will be in touch with you asap to discuss.

Name(*)
Please type your full name. Also only allowing alpha numeric characters here. Why do you have all this fancy stuff in your name anyway?

Email(*)
Invalid email address.

Phone
Please enter a valid phone number.

Enquiry Type(*)
Invalid Input

Message(*)
Please only use alphanumeric characters in your message

Invalid Input