Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Add custom code to homepage only

Hello,

I cant seem to get my head around the templating system and how the views work in vanilla. I have a site with categories&discussions as homepage and I want to add some custom content after the header, but don't want it to show on other pages.

I have tried editing the master template, discussions view files and installing custom pages plugin. With custom pages plugin i couldn't get the categories and discussions and the sidebar to show.

Just don't get it.. I find the views very confusing. How do I add custom content to the homepage?

Best Answer

Answers

  • look at body id, :)

    so lets say the body id of index is id="vanilla_index" then you can target a css rule just for that id occurence.

    There was an error rendering this rich post.

  • Thanks for the fast reply.

    But I can't actually use a css hack like that. The code I'm about to include is some heavyweight php that the server cannot afford to run on every page load in vain.

  • lifeisfoolifeisfoo ✭✭✭

    There was an error rendering this rich post.

Sign In or Register to comment.