[TYPO3] Multiline vertical GMENU

JoH asenau info at cybercraft.de
Thu Apr 17 15:06:10 CEST 2008


> I am using a GMENU to construct a vertical menu.
> The problem I'm having is when the title of the menu item exceeds a
> certain width.
> For example one of the pages is called "Learning Community" I would
> like to add a line break after the first word.
>
> Learning Community - What it looks like now
>
> Learning - What I want it to look like
> Community
>
> I did some research and found some code using the splitChar and
> listNum functions which would seem to accomplish what I need.

This is far from being optimal :-)

Usually it should be enough to use the nav_title field for this purpose.
The only thing you have to do is: Set the form_type of this field to "text".

$GLOBALS['TCA']['pages']['columns']['nav_title']['config']['form_type'] =
'text';

You can do this within a global ext_tables.php file in typo3conf or using
the same file of a small extension created with the kickstarter.

This way the form field display of nav_title will switch from input to
textarea while keeping the evaluation of the input field. This means: You
can simply enter line breaks, which will be automatically recognized by the
GIFBUILDER functions.

You can keep the original one line title, no need for a second TEXT element
within the menu setup and all the calculation can be done with a single
element as well.

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
openBC/Xing: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com
Jobs: http://www.professionals-only.com




More information about the TYPO3-english mailing list