Page 1 of 1

How to <br> in menu ?

Posted: Fri Feb 26, 2016 7:16 pm
by bastingse
Folks, i wonder if this is possible to make.

If i use a menu, lets say "toxic_xh", as horizontal menu. Is it possible to use a <br> in the menu?
If i use this in the page:
<h1>Menubutton/<br>in two lines/<br>or even three</h1>
Then this is showing exactly as i ment it should on the page, but in the meu (tc, toxic) it is only one line.

Can this be done somehow?????

Hope you understand what i mean :-)

Thanks already!
Emile

Re: How to <br> in menu ?

Posted: Sat Feb 27, 2016 10:02 am
by cmb
bastingse wrote:Is it possible to use a <br> in the menu?
The labels of the menu items are given by the $h array, which contains the page headings without any HTML tags. To allow <br> elements in the menu, you would have to modify the $h array, which might have some unwanted side-effects. Anyway, you can try it out by modifying a single line in cmsimple/functions.php:

Code: Select all

        $temp_h[] = trim(xh_rmws(strip_tags($temp[2], '<br>')));

Re: How to <br> in menu ?

Posted: Sun Feb 28, 2016 8:06 am
by bastingse
cmb wrote: which might have some unwanted side-effects.
Whow !!! This works !!!!
Perfect, just what i needed !! So much appreciate this !!
What can be the unwanted side-effects??

Re: How to <br> in menu ?

Posted: Sun Feb 28, 2016 9:42 am
by cmb
bastingse wrote:Whow !!! This works !!!!
Great!
bastingse wrote:What can be the unwanted side-effects??
Well, $h (i.e. the page heading) is used for other purposes, too, so there might be cases where the <br> causes trouble or is at least unwanted. That might particularly the case with some plugins using $h. However, if it works for you, it's fine.

Re: How to <br> in menu ?

Posted: Sun Feb 28, 2016 9:50 am
by bastingse

Re: How to <br> in menu ?

Posted: Fri Aug 12, 2016 2:47 am
by sophiamaria
Useful replies! Thank you. I don't understand this, neither..=))

Re: How to <br> in menu ?

Posted: Fri Aug 12, 2016 4:53 am
by Tata
sophiamaria wrote:Useful replies! Thank you. I don't understand this, neither..=))
If you use plugins on the page, test if all of them work properly.