Results 1 to 3 of 3

Thread: Adding breaks <br> to navigation elements

  1. #1
    New user
    Join Date
    09-22-11.
    Posts
    26

    Default Adding breaks <br> to navigation elements

    I need to make a navigation menu like this (notice the breaks):

    Some text
    here

    Some more
    text here

    Other text
    here

    My question: how do I add
    to a link?

    Some text
    here
    Some more
    text here
    Other text
    here

    Does anyone know how to do this with Contao? It would be great if I would not have to resort to a custom template, so the client doesn't need to dig into that in case he needs to change something...

    UPDATE: I have used str_replace('/break/','
    ', $item['link']); in the standard nav template, and in the Site Structure I added /break/ to the page name. This is ugly but it works. Any suggestions for a less ugly solution are VERY welcome

  2. #2
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: Adding breaks <br> to navigation elements

    It's possible to modify the field to accept HTML code, but that would likely break or look very ugly anywhere else a page label is referenced (i.e. in the back-end or a meta title).

    If you just need it to wrap at a certain width -- instead of needing to specify exactly which words, maybe you can try doing this in CSS by limiting the widths of the navigation links, forcing them to wrap.
    Brian

  3. #3
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Adding breaks <br> to navigation elements

    what about changing the field to accept a linebreak. (or replace /break/ with a linebreak char). The backend willh. ignore, but css in the frontend could be white-space: pre;

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •