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.

Including the panel elsewhere?

edited October 2007 in Vanilla 1.0 Help
I'm currently working on a single column theme (almost similar to MiniVanilli or Dreamless) that requires the panel to be included just below the page title.

Here is before and after examples.



I've tried to include the panel.php file, copy/paste the contents but to no avail :(
I also tried just hard coding them in, but hit a snag with things like permissions on users' profiles and bookmarking/unbookmarking threads.

So can anyone help me here?

Thanks :)


  • if your just trying to put everything into one column, you should only have to edit the css a bit and remove some closing/opening divs between the panel and content divs and menu and panel divs
  • edited February 2007
    Well this is more than just a quick css makeover on the default theme. About 40% or so is custom PHP/XHTML/CSS so unfortunately just moving stuff around won't help :(
  • edited February 2007
    you may have problems with all this stuff running off the page... but meh, here's the code you'll probably need anyways cos the look of that theme is awesome :D

    in vanilla.css, add use this for the links
    #Panel a { padding-right: 5px; }

    and then use this, though i haven't tested it out yet
    <?php // Note: This file is included from the library/Framework/Framework.Control.Panel.php class. echo '<div id="Panel">'; // Add the start button to the panel if ($this->Context->Session->UserID > 0 && $this->Context->Session->User->Permission('PERMISSION_START_DISCUSSION')) { $CategoryID = ForceIncomingInt('CategoryID', 0); if ($CategoryID == 0) $CategoryID = ''; echo '<a href="'.GetUrl($this->Context->Configuration, 'post.php', 'category/', 'CategoryID', $CategoryID).'">' .$this->Context->GetDefinition('StartANewDiscussion') .'</a>'; } $this->CallDelegate('PostStartButtonRender'); while (list($Key, $PanelElement) = each($this->PanelElements)) { $Type = $PanelElement['Type']; $Key = $PanelElement['Key']; if ($Type == 'List') { $sReturn = ''; $Links = $this->Lists[$Key]; if (count($Links) > 0) { ksort($Links); $sReturn .= '<b>'.$Key.'</b> '; while (list($LinkKey, $Link) = each($Links)) { $sReturn .= ' <a '.($Link['Link'] != '' ? 'href="'.$Link['Link'].'"' : '').' '.$Link['LinkAttributes'].'>' .$Link['Item']; if ($Link['Suffix'] != '') $sReturn .= ' <span>'.$this->Context->GetDefinition($Link['Suffix']).'</span>'; $sReturn .= '</a>'; } } echo $sReturn; } elseif ($Type == 'String') { echo strip_tags($this->Strings[$Key], "<b><i><a><strong><span><font>"); } } $this->CallDelegate('PostElementsRender'); echo '</div> <div id="Content">'; ?>
  • Is it just me that sees the irony in making a single column theme then having a block at the side of the post with the users information in? xD I was going to suggest checking out one of the other single column themes but there dont seem to be any...i'm sure some have been made though..wierd.
  • Vincent thats what my panel.php already looks like. I just removed the "Start new discussion" button and moved it somewhere else.

    What I meant was that I'm having trouble including the panel in a different place from where it is. If I try to add things such as page title and pagination inside of the panel.php file, I get errors.

    As for the css, I just haven't gotten around to styling it yet ;)

    Minisweeper: Haha yeah.

    Here is a larger shot, so you can see what I mean (right click for larger).
  • Why dont you take the user info off the side and put it above the comments, then put the panel in its place? You could call it 'Vanilla'.. :D What do you mean by 'page title and pagination'?
  • By page title (I guess header is a better word?) " Lorem Ipsum..." or "All Discussions" if you're on the index.

    And by pagination I meant "(1 to 4 of 4)".
  • Again, all you have to is edit the css a bit, and change up some info between the menu/panel -- panel/content, if i wasn't in bed getting ready to go to sleep i'd do it right now
  • After going back to play with the structure (even on the default theme), I still can't get it to work since it means I need to actually include part of the panel somewhere else. Unless I'm missing something totally obvious, which is more than likely :/

    For now I'll just hardcode the links in, which partially solves my problem.
  • wow, i started working on a style almost exactly like this in the past two weeks. hahaha

    i was having the same problem and gave up on it.

    do you plan on releasing this style???
  • edited February 2007
    If the only problem your having is moving a portion of the code do this

    add this to the bottom of global.js...
    function cleanLoad(){ var relocatePanel = document.getElementById("panel").innerHTML; document.getElementById("relocated_panel").innerHTML = relocatePanel; }

    open up head.php and you will see this line all the way at the bottom..
    <body'.$BodyId.' '.$this->Context->BodyAttributes.'>';

    replace that line with this...
    <body onload="cleanLoad()" '.$BodyId.' '.$this->Context->BodyAttributes.'>';

    now, upload your global.js and head.php - you are now setup to relocate anything within your vanilla environment.

    now wrap everything in the panel.php file that you want to relocate like so..
    echo '<div id="panel" style="display:none;">'; everything in panel you want to relocate goes here! echo '</div>';

    then open up the file where you want this stuff at, and do this..
    echo '<div id="relocated_panel"> </div>';

    upload everything and there you go.
  • Ah, thats working perfectly. Thanks a ton!

    Outbreak: I wasn't planning on it since I didn't expect anyone to be interested, but if you are I'll release it in a few weeks :)
  • edited February 2007
    Wrote it myself, glad you like it. If I told you what it'd really be useful for i'd have to kill you :) btw, i've only been able to test the javascript in IE and FF so maybe (( for informative reasons )) you can get someone to test it in other browsers too. Since I'm sure this is a frequently discussed topic amongst people trying to move stuff around. oh yes, and note what vincent said unless your completely gutting out your theme files and using your own style sheets.
  • Outbreak: I wasn't planning on it since I didn't expect anyone to be interested, but if you are I'll release it in a few weeks :)
    yeah, definitely!!! not only will it make my life much easier (haha), but it's one of the best i've seen so far.
  • Please do release it. You should always release stuff, even if you don't plan on supporting it IMO - just make it 100% clear that you won't support it, that's all, then people will be under no illusions :)
  • Any news on this theme?
  • I managed to break the AJAX and some authentication stuff, so I'll have to pick through to figure out where I went wrong.

    Could be a while :/
  • good luck, this looks really fantastic if you were doing a variant with the username/post options above rather than to the right, that would be fantastic as well
  • i can't wait to see this bad boy finished. it's going to be awesome.
  • Oh, I like this a lot.

    Keep up the good work. =o)
This discussion has been closed.