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

Embed forum within another site layout.

RaizeRaize vancouver ✭✭
edited October 2008 in Vanilla 1.0 Help
How would one accomplish building a site in dreamweaver and then placing the forum (as is) within the graphical layout of that site. Would it be done using tables?

P.S. I am not looking for step by step directions or anything, just some guidance so that I can do more research into it and learn how it could be done. ie. a general idea


  • Well if you mean Dreamweaver in code view then you can, if you mean in Design view (the graphical way of making websites) I don't know if it's possible.
    If you mean the code view you are in luck because Vanilla has anticipated this need. In your installation folder, open the themes folder and in there you will see head.php, adding code to the end of that (in the last echo) will allow you to put things like your website header and menu above the Vanilla forum. If you have a footer to add, then you add the code to foot.php. Hopefully this helps, feel free to ask more about it because it is the first thing I do when I install Vanilla
  • I'm okay with HTML, but clearly my php is terribly lacking. I was wondering if you could give me an example of what the code would look like to add an image banner that links back to my main site? And where exactly in head.php would that go? Thanks so much!
  • In one of my forums here (it is a closed forum so don't expect to see much) all I did was add some code to line 21 of themes/menu.php. Here is my entire themes/menu.php file so you can see what I mean:
    <?php // Note: This file is included from the library/Vanilla/Vanilla.Control.Menu.php class. echo '<div id="Session">'; if ($this->Context->Session->UserID > 0) { echo str_replace('//1', $this->Context->Session->User->Name, $this->Context->GetDefinition('SignedInAsX')) . ' (<a href="' . FormatStringForDisplay(AppendUrlParameters( $this->Context->Configuration['SIGNOUT_URL'], 'FormPostBackKey=' . $this->Context->Session->GetCsrfValidationKey() )) . '">'.$this->Context->GetDefinition('SignOut').'</a>)'; } else { echo $this->Context->GetDefinition('NotSignedIn') . ' (<a href="' . FormatStringForDisplay(AppendUrlParameters( $this->Context->Configuration['SIGNIN_URL'], 'ReturnUrl='. urlencode(GetRequestUri(0)))) . '">'.$this->Context->GetDefinition('SignIn').'</a>)'; } echo '</div>'; ?> <a name="pgtop"></a> <a href="/" title="home" id="pagetop"><img src="/_images/logo.png" alt="logo" style="float:left;" /></a><div id="menu"><a href="/rappelz/information/" title="information"><img src="/_images/menu-information.png" alt="information button" /></a><a href="/rappelz/forum/" title="forum" ><img src="/_images/menu-forum.png" alt="forum button" /></a><a href="/rappelz/links/" title="links" ><img src="/_images/menu-links.png" alt="links button" /></a><a href="/rappelz/forum/siege/" title="siege" ><img src="/_images/menu-siege.png" alt="siege button" /></a></div><br style="clear:both;" /> <?php $this->CallDelegate('PreHeadRender'); echo '<div id="Header"> <h1> '.$this->Context->Configuration['BANNER_TITLE'].' </h1> <ul>'; while (list($Key, $Tab) = each($this->Tabs)) { echo '<li'.$this->TabClass($this->CurrentTab, $Tab['Value']).'><a href="'.$Tab['Url'].'" '.$Tab['Attributes'].'>'.$Tab['Text'].'</a></li>'; } echo '</ul> </div>'; $this->CallDelegate('PreBodyRender'); echo '<div id="Body">'; ?>
  • Anyone got an example of adding code to the head/foot files?
  • SubJunkSubJunk ✭✭
    edited October 2008
    It's the exact same thing as what I just gave. menu.php just comes after head.php
    If you want to add some HTML to head.php just add it to the end. You see how it ends at line 43, just push enter and make line 44 after the closing php tag and write your code in HTML. For example here is how you add a link to the top of the page using head.php:
    <?php // Note: This file is included from the library/Framework/Framework.Control.Head.php class. $HeadString = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'.$this->Context->GetDefinition('XMLLang').'"> <head> <title>'.$this->Context->Configuration['APPLICATION_TITLE'].' - '.$this->Context->PageTitle.'</title> <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" />'; while (list($Name, $Content) = each($this->Meta)) { $HeadString .= ' <meta name="'.$Name.'" content="'.$Content.'" />'; } if (is_array($this->StyleSheets)) { while (list($Key, $StyleSheet) = each($this->StyleSheets)) { $HeadString .= ' <link rel="stylesheet" type="text/css" href="'.$StyleSheet['Sheet'].'"'.($StyleSheet['Media'] == ''?'':' media="'.$StyleSheet['Media'].'"').' />'; } } if (is_array($this->Scripts)) { $ScriptCount = count($this->Scripts); $i = 0; for ($i = 0; $i < $ScriptCount; $i++) { $HeadString .= ' <script type="text/javascript" src="'.$this->Scripts[$i].'"></script>'; } } if (is_array($this->Strings)) { $StringCount = count($this->Strings); $i = 0; for ($i = 0; $i < $StringCount; $i++) { $HeadString .= $this->Strings[$i]; } } $BodyId = ""; if ($this->BodyId != "") $BodyId = ' id="'.$this->BodyId.'"'; echo $HeadString . '</head> <body'.$BodyId.' '.$this->Context->BodyAttributes.'> <div id="SiteContainer">'; ?> <a href="www.link.com">here is a link</a>
    If you want to add a link to the bottom of a page, foot.php, just put your HTML at the top of that file, before the opening php tags, like this:
    <a href="www.link.com">here is a link</a> <?php // Note: This file is included from the library/Vanilla/Vanilla.Control.Foot.php class. echo '</div> <a id="pgbottom" name="pgbottom">&nbsp;</a> </div> </div>'; $AllowDebugInfo = 0; if ($this->Context->Session->User) { if ($this->Context->Session->User->Permission('PERMISSION_ALLOW_DEBUG_INFO')) $AllowDebugInfo = 1; } if ($this->Context->Mode == MODE_DEBUG && $AllowDebugInfo) { echo '<div class="DebugBar" id="DebugBar"> <b>Debug Options</b> | Resize: <a href="javascript:window.resizeTo(800,600);">800x600</a>, <a href="javascript:window.resizeTo(1024, 768);">1024x768</a> | <a href="' ."javascript:HideElement('DebugBar');" .'">Hide This</a>'; echo $this->Context->SqlCollector->GetMessages(); echo '</div>'; } ?>
  • Thanks SubJunk, I'll try that sometime tomorrow!
  • Slight problem since I modified the foot.php file. When displaying the categories page the footer is displayed away to the right. On all the other pages linked by the tabs it displays in the right place ie at the foot of the page. Any ideas?
  • Could you provide links?
  • Does it still do that when there are actually categories there? It's possible that when you add a category or two it will make the footer float down and left more.
  • Oh also you should really upgrade from 1.1.2 to 1.1.5a
  • edited October 2008
    You would have to register to see any categories - sorry should have mentioned it before! And no - the number of categories doesn't shift it any. Loathe to upgrade as the embed mod works okay with my current version which is itself a mod for ELGG and I'm happy with it. We are, however, keeping up with the security updates....
  • Does putting another </div> before the custom footer code fix it?
This discussion has been closed.