Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Another integration question - "wrapper" around vanilla output

edited October 2007 in Vanilla 1.0 Help
In trying to do a seamless integration of Vanilla into Dolphin, both use classes to display their own pages. What I'd like is to be able to display the forum INSIDE the Dolphin page/theme. The Dolphin header & menus are dynamically generated, so I don't think I could use an add-on like Nugget to display it. Option 1: If I were able to get Vanilla to port it's output to a variable, I might be able to build a custom page in Dolphin and echo the Vanilla output inside of it - not sure it this'll work. Option 2: Do an include("dolphin_header") at the top of one of the Vanilla files and see if it'll work that way. I'm not sure which would be easier, but I think either way it would be a pain. Do any Vanilla geeks out there have any suggestions?

Comments

  • Option 1: I can't think about a way to wrap Vanila this way. It seems tricky since urls built by vanilla will send you to vanilla urls. Don't know where would be the shortcut.
    Option 2: this work well for me, I can even call my framework from there (see the very end of this page).

    - override menu.php (removed the <div id="Session"> and used <?php $obj =& get_instance();echo $obj->load->view('my_menu', null, true); ?> to catch the menu I use everywhere on my site)
  • As far as authentication, I was able to write a quick and dirty cookie routine within Vanilla. The reason option 1 is difficult is because Vanilla is not generated from one calling function (or page for that matter). Instead, each main function has it's own calling file (categories.php, account.php, etc). I'm not dissing Vanilla, that's just how it is.

    I might try the menu.php override. I settled on using an IFRAME, but it's not the best solution. You can see it here if you like.

    Even if I override the menu.php, I'm still not sure how I would wrap the forum within the main template.
  • I think you can achieve this task using output buffering (ob_start()/ob_get_clean()). Themes files head.php and foot.php being good candidates for controlling the buffer.
  • "each main function has it's own calling file": that's what I was trying to explain !!! This is good phrasing.
    When I gave my menu.php example, it was just a hint. Max_B is right: head.php and foot.php are far better candidates.
    note: ob_start() is called in appg/init_vanilla.php, so there's no need to call it once again
    But I guess Max_B is talking about option 1. I still don't get how to WRAP the execution and the buffer in something. Is there a magic trick ?

    I think that the iframe is not a clean solution, you won't be properly indexed by search engines, if you ever what to be...
  • Max_BMax_B New
    edited October 2007
    Depends of what we call "wrap". If your goal is to have the output of Vanilla included in some other html layout, as many of us want, I see two ways:
    - the first "traditional" is to use theme files to add the other layout.
    - the second is to prevent vanilla from outputing anything out and get its output in a string (ob_get_clean()) then use this string the way you want in your layout. To achieve this you can design a theme without global tags (doctype, head, html, body). Vanilla is run from a given url, as usual, but the relevant logic called from head.php and/or foot.php traps the output and wraps it. Some tricky issues may require a custom extension.
This discussion has been closed.