HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Replace Homepage with my own content

What is the best way to do this....

If i have a custom page created by a plugin is there a way to set the homepage route into it?

Thanks

Comments

  • KasparKaspar Moderator

    Take a look at

    https://docs.vanillaforums.com/developer/routes/

    Predefined routes > Defaultcontroller

    R_Jrloyola
  • edited August 2019

    Also, if you just want to add simple static content without rerouting ... in your template, default..master.tpl there is a nice smarty variable you can use to decide what to show in your homepage. It is $isHomepage

    You can load an entire new page template design if you want

    {if $isHomepage}
    <!DOCTYPE html>
    <html>
    <title>my homepage</title>
    <body>
    {pocket name="homePagePocket"}
    Hey Look I got rid of the discussion or categories listing ... hahahaha hehehehe
    </body>
    </html>
    {else}
      {include file="partials/mainSitedesign.tpl"}
    {/if}
    

    Or if you like your existing main rest-of-the-site design so much but want to nuke the forumisque discussion/categories list side of things

    {if $isHomepage}
    {pocket name="homePagePocket"}
    {module name="homePagePocket"}
    
    {else}
    {asset name="Content"}
    {/if}
    
    //and elsewhere on the page
    
    {if $isHomepage}
    <div> I am homepage side bar</div>
    {else}
    {asset name="Panel"}
    {/if}
    

    Use include and pockets  and modules to make things a little less hazardous, and tidy.

    https://docs.vanillaforums.com/developer/framework/modules/

    https://blog.vanillaforums.com/product/power-pockets-adding-custom-html-js-vanilla-forum

    rloyolaKaspar
  • wow, the editor mangled my response above

    rloyola
Sign In or Register to comment.