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.

Framework Page handling

edited June 2006 in Vanilla 1.0 Help
While I was working on the To-do extension, I had to re-create something similar to the index.php to generate an empty page, with just only my controls. I've put this piece of code into my extension. (Actually I copied it from the PageManager extension, but I had the same idea :P). What I want to say is... I'm working on a new extension which needs an empty page, and so again I have to add 30-40 lines with the same code. A question to Mark: could you add something like a template file "page.php" to the root of vanilla? This way developers can use that to build their own page.

include("appg/settings.php"); include("appg/init_vanilla.php"); // 1. DEFINE VARIABLES AND PROPERTIES SPECIFIC TO THIS PAGE // Ensure the user is allowed to view this page $Context->Session->Check($Context); // 3. ADD CONTROLS TO THE PAGE $Page->AddRenderControl($Head, $Configuration['CONTROL_POSITION_HEAD']); $Page->AddRenderControl($Menu, $Configuration['CONTROL_POSITION_MENU']); $Page->AddRenderControl($Panel, $Configuration['CONTROL_POSITION_PANEL']); $Page->AddRenderControl($NoticeCollector, $Configuration['CONTROL_POSITION_NOTICES']); $Page->AddRenderControl($Foot, $Configuration['CONTROL_POSITION_FOOT']); $Page->AddRenderControl($PageEnd, $Configuration['CONTROL_POSITION_PAGE_END']); // 4. FIRE PAGE EVENTS $Page->FireEvents();

Also, I can add tabs, even put them before the discussion tab... But how on earth can I tell the Framework to "startup" the application with this new tab? (Select it as default). Ofcourse, I could change the core, but I want to do it in an extension.

Comments

  • Hi Jazzmann,
    there's one there already that's almost identical to yours: extension.php. In the description it says "Description: A blank page for extensions". I must say I only discovered it recently myself.
  • Oooooh!! Great!! That what I was looking for!! Pfft.. Mark thinks of everything :D
  • Haha. I read this earlier and thought that was what extension.php did but didnt have the code to check and assumed jazzman would be two steps ahead anyway. Maybe not though.... ;P
This discussion has been closed.