Add custom box into template page

  • Affected Version
    WoltLab Suite 5.5
    Affected App
    WoltLab Suite Forum

    I was hunting the forums for the answer to this and all I found was the below code. This seems to not work so I was wondering if the way has been updated or has changed.


    I'm adding a page and choose "template" as the option. I want to add a custom box into the template. Is this possible?


    Code
    {include file='__cms_box_ID'}
  • Hello,


    templates of box are generated as template files for performance reasons and should never be manually included. That said, there have been no changes whatsoever.

    Hi Alexander,

    As always thanks for the feedback.


    I'd like to create pages with static items like a simple HTML navigation menu and include them on multiple pages. The thought is, if I need to make a menu change, I do it in that box/template file and it changes on all pages where I inserted it. I thought a simple HTML box would do the trick, but I realized I could actually create my own template file, add the HTML and place it into the page.

  • Why not just use the box as-is on the page? And if you want a navigation menu, why not use an actual menu and place it like any other box? It sounds a bit to me that you are reinventing the wheel over there? ;)

    100% true haha. I was taking your suggestion and playing around with css:grid and made a page with two columns. I wanted the left column to be the sidebar and the right bar to be the main content. Now that I think about it, I should just do what you suggest and use the built in side bar.

  • Relying on the built-in menus (which are technically just a special type of box) has another perk: Menu items show as active when the page is viewed and it supports unread counters.

    Talking about the menu, is this a "system" box or do I need some special template code in order to insert the menu?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!