Back to Homepage
What is SiteBar?
Screenshot Tour
Getting Started
Services and Prices
Get Involved!
Contact Us
Download Server Software (GPL)
Development Team
Embedding SiteBar
Bugzilla - [Search] [New]
Forums - [Help] [Features] ...
Project Information
The menu above
Powered by PHP Layers Menu
SiteBar in IFRAME

Embedding SiteBar

SiteBar can be embedded to any page using IFRAME (see the left bottom part of this screen). Please note, that MS IE users may experience cookie related problem when you embed SiteBar installed on some domain (lets say to your page running at They will have to allow the 2nd level domain to place cookies in the browser settings.

Embedded Writer (requires SiteBar 3.3.12)

The SiteBar tree reendered bellow is not included in an IFRAME. It is directly embedded into this page using PHP code. Lets assume that SiteBar is installed in the sitebar subdirectory - our test file is now called emb.php, and available at http://localhost/emb.php. SiteBar is available at http://localhost/sitebar. Lets make it interesting by using other than the default skin:

$oldDir = getcwd();
// SiteBar PHP files must be available on this server,
// we change temporarily to the installation directory.
// Inject direct and indirect classes
// Create the writer object.
$writer = new SB_Writer_sitebar_emb();

// Do we want another skin?

// We change both the absolute and the relative URL,
// we may run on a different subdomain or use an alias.
// Restore pwd, if you want to load some other files

We will need to link the style sheet and javascript library (pay attention to every single /):

<link rel="StyleSheet"
    href="<?php echo SB_Skin::src('sitebar.css')?>"
    type="text/css" media="all">
<script type="text/javascript"
    src="<?php echo SB_Page::absBaseUrl() ?>inc/sitebar.js">

We need to store some hidden data on the page:

Loading ...
<div style="display:none">

And here we execute following command to render the tree, we include it in the div with proper class names to apply the SiteBar styles only inside of the div and not on the complete page.

<div class="siteBar siteBarBaseFont siteBarPageBackground">
Ondrej Brablc's Bookmarks
Kucera IPC GmbH
Life in Germany
Ne softwarovým patentům!
Mats Bergsten's Bookmarks

If you still do not see anything, it may be because you have not published any bookmarks, so either publish them, or execute following line before the run() command (username and password should be replaced with correct credentials):


Blogroll Writer

Adding a list of newest links to your page could be as easy as putting there following JavaScript code:

PHP Layers Menu

SiteBar can provide input for PHP Layers Menu. The url may look like The use inside of PHP LM is as easy as using this URL instead of the filename with the menu structure, in our case we execute this

// This will be done in the <head>
include ("phplm/lib/PHPLIB.php");
include ("phplm/lib/");
include ("phplm/lib/");
$mid->dirroot = "./phplm/";
$mid->libjsdir = "./phplm/libjs/";
$mid->imgdir = "./phplm/images/";
$mid->imgwww = "phplm/images/";
$mid->tpldir = "./phplm/templates/";
$mid = new LayersMenu();

// And this will go to the place where menu should be shown
print $mid->printMenu("vermenu1");

And where is the output? Just check the gray menu block on the left side. It is automatically populated from the database.

The site and services are proudly provided by SiteBar authors. SiteBar is free open source software. Copyright © 2003-2019 Ondřej Brablc, © 2004 SiteBar Team, © 2003 David Szego.