We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19781
    • 6 Posts
    I would like to have my Fontpage without sidebar. Is there any way to remove sidebar from one document. Let’s say I put in the template before sidebar <div> something like <php if this is my frontpage then .........do not display sidebar div..> . would that work ? would anyone kindly can advise me on that issue?

    Many thanks
    m.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      That’s what TVs are good for. Make a TV to contain your entire sidebar (input type of textarea or rich text) with the default content the html with tags for your sidebar. Then in the homepage, edit the TV and simply delete everything. Now there won’t be a sidebar in the home page.

      If for some reason that doesn’t work (maybe it won’t like it if there are other TVs in the sidebar), just make a separate template for your homepage.

      There was a snippet called "HomeAlone" that would do this, but ever since TVs came out I haven’t used it.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 10226
        • 412 Posts
        I would just copy your template to a new one and ’cut’ the sidebar out. This is also a good time to convert your templates into chunks so you can easily modify templates by modifying the chunks - instead of making the same changes to multiple templates.

        I use something like this..

        {{head}}
        {{java_base}}
        </head>
        {{body}}
        {{menu}}
        [*content*] 
        {{footer}}
        {{body_close}}


        This might not be as simple for you - I use a single column template.

        Good Luck!