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

Wrapping vs. Embedding?

edited March 2011 in Vanilla 2.0 - 2.8
Rather than embedding Vanilla is there a way to simply wrap the site in a header and footer instead? I am using Wordpress. For other external pages, I just call get_header() before the content and get_footer() after to wrap the pages, and it works flawlessly.

Embedding Vanilla leaves me with several problems: cannot get pretty URLS, search engines don't index, when Vanilla uses the Wordpress login/register page, it redirects back to the main site by embedding it within the forum IFRAME, so they double up so to speak, and the http://www.domain.com/vanilla link still works, bypassing my website, which I am inclined to not prefer. There may be other issues I've not discovered yet, I've only been running the forum for a couple of days.

Comments

  • Options
    Haw would be the cod to wrap vanilla foum in the header and footer of wordpress ?
  • Options
    Not sure what "Haw would be the cod" means, but I managed to do it by manually adding HTML code to the default template using the {literal} tag, but I'm still looking for a PHP solution that would allow me to call the get_header() and get_footer(). As it is, every time I modify the wordpress header and footer, I need to also modify the default template to match.

    I'm still new to vanilla, like two days, so I hope to get it figured out soon.
  • Options
    edited April 2011
    I was successful in getting my forum wrapped inside a a header and footer using PHP, which enables me to use the same files throughout my system, including in files external to the forum.

    1. Copy default.master.php from /applications/dashboard/views to your theme's views folder.

    2. create 3 files header-meta.php, body-header.php and a body-footer.php. Put inside header-meta.php the stuff you want loaded right after the <head> tag. Put inside body-header.php the stuff you want loaded right after the <body> tag and put in body-footer.php the stuff you want loaded just before the </body> tag.

    3. create a folder somewhere on your site to keep your wrapper files.

    4. include the files in the appropriate places in your default.master.php file. Note that the includes will be relative to your forum install, so for instance if your forum is installed at www.domain.com/vanilla and your wrappers are in www.domain.com/wrappers then you will include them using include('../wrappers/header-meta.php'); etc. Also note that Vanilla will strip any unclosed HTML tags, so you cannot open a div tag in body-header.php and expect to close it in body-footer.php. You will need to add those div tags to default.master.php directly. It is safe to leave any unclosed HTML tags in the wrappers for use in other files however.

    [Edited to fix tags stripped during display]
  • Options
    It is much more interesting to add related discussions via SSI or PHP ala Addons on this site.
  • Options

    @tjforsythe You seem to be the only person in the internet explaining the wrapping of a vanilla forum - thanks a lot for that! :)

    I created all the files you mentioned and it seems to be ok. My problem, however, is that I don't know what to include in the three new files. I know where the wordpress header and footer are but thats it. Could you give a tip? It would be greatly appreciated!

  • Options
    422422 Developer MVP

    Dont use wrap method for wordpress. ( by that don't use includes as mentioned )

    There was an error rendering this rich post.

  • Options

    @422 why is that?

  • Options
    422422 Developer MVP

    Same reason you dont use a screwdriver to paint a wall. Use embed.

    There was an error rendering this rich post.

  • Options
    peregrineperegrine MVP
    edited June 2012

    422 said:
    Same reason you dont use a screwdriver to paint a wall. Use embed.

    @422 why is that?
    I have had remarkable results with a screwdriver - takes an awful long time though. oil-based paint works better though.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    422422 Developer MVP

    Lololol

    There was an error rendering this rich post.

  • Options

    I am using embed right now and it is okay, but there's a lot of holes in it. It's easy for a user to land outside of embed and the theme looks pretty funky without the header or footer. I'm curious why the instance of using embed when it is so unrefined at the moment.

  • Options

    Embedding is impossible for me! I've done everything, tried everything, but I can't get the < script > code to stick in my page editor; it just keeps getting stripped no matter what I do. I'm using the Catalyst theme and it might be that, but the friendly folks on their forums don't seem to think so.

    So that said, it seems like my only available tool for painting this wall is a screwdriver...unless 422 has a better idea for me, or unless there's a non-script HTML code I can use for this embedding business.

Sign In or Register to comment.