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.
Options

[Solved] Custom headers and Footers

422422 Developer MVP
edited October 2011 in Vanilla 2.0 - 2.8
Hi guys first post here, I simply love vanilla, it is so easy to customize.

My question is thus, we have a existing website, with our own custom header and footer, and would like to plonk vanilla into it. But I dont think I would like to use embed method, I would rather do a hard coded affair.

Generally we would include headers and footers , like so:

<? $title = "Forum"; ?>
<?php include("/includes/_doc_head.php"); ?>

and for footer.

<?php include("/includes/_doc_foot.php"); ?>

So my question is, how and where should we begin looking to add these to some global template to mimic our sites header and footers, we generally set base href also. So really I would just like to wrap our header/footer around the vanilla forums.

We have created custom theme, if thats of any significance.

Cheers Ste

There was an error rendering this rich post.

Tagged:

Answers

  • Options
    x00x00 MVP
    edited October 2011
    Your default.master should be in your theme. If you are using a .tpl file investigate using a smarty custom template function.

    Easier if you are using .php master then you can just include where needed.

    Third option is to hook header and footer events with a plugin.

    Bare in mind what you are attempting to do has some perils, you are basically crowbarring in functionality. Obviously it needs all the associated resourced the head section.

    Probably safest of all is to simply recreate the same header an footer, and give the impression of homogeneousness.

    grep is your friend.

  • Options
    422422 Developer MVP
    edited October 2011
    Thanks, yeah I dont see why we would have issues, just wondered what is best page to hook our includes into.

    Note: our site is custom php, built from ground up, not smarty or indeed does it include any tpl file structure

    There was an error rendering this rich post.

  • Options
    422422 Developer MVP
    x 00 , you are indeed correct ! Apologies, I am showing my lack of understanding and reading the Vanilla docs. That is exactly the correct answer, thankyou

    There was an error rendering this rich post.

  • Options
    ToddTodd Chief Product Officer Vanilla Staff
    @422 then why did you reject his answer?
  • Options
    422422 Developer MVP
    edited October 2011
    That was accidental, and then I could not see a way to re accept his answer, a la Stackoverflow style. If you show me where I will. Hence I replied

    There was an error rendering this rich post.

Sign In or Register to comment.