You are not logged in.

Announcement

Forum database was corrupt and an old backup was restored as temporary replacement. Registrations closed until the database is recovered. Please ask questions using the Contact form

#1 07-07-2014 11:37:04

PierreUnge
Contributors
From: Malmö, Sweden
Registered: 30-06-2013
Posts: 2

Dynamic sidebar possible?

Hi all,
I am trying to make a dynamic sidebar with different tiles depending on a result form a database. Any ideas in the actual code for the tiles as in this example

[== Undefined ==]
$sidebar["name"] = array("pos"=>"left","size"=>2,"full_height"=>false,
	"tiles"=>array( /* Open the array of sidebar tiles */
		$tile[] = array("type"=>"simple","group"=>0,"x"=>0,"y"=>0,'width'=>2,'height'=>0.35,"background"=>"#777","url"=>"newtab:jquery.com","title"=>"jQuery","text"=>""),
		$tile[] = array("type"=>"simple","group"=>0,"x"=>0,"y"=>0.35,'width'=>2,'height'=>0.35,"background"=>"#777","url"=>"newtab:http://ace.ajax.org/","title"=>"ACE editor","text"=>""),
		$tile[] = array("type"=>"simple","group"=>0,"x"=>0,"y"=>0.7,'width'=>2,'height'=>0.35,"background"=>"#777","url"=>"newtab:http://crisp.tweakblogs.net/blog/cat/716","title"=>"JSMin+","text"=>""),
		$tile[] = array("type"=>"simple","group"=>0,"x"=>0,"y"=>1.05,'width'=>2,'height'=>0.35,"background"=>"#777","url"=>"newtab:https://github.com/serbanghita/Mobile-Detect","title"=>"Mobile-Detect","text"=>"")

	), /* Close the array of sidebar tiles */
	"load_plugins"=>array() /* Load plugins from the plugin folder so you can use tileplugins */
);

Think of it as I don't want the 2nd tile in some cases, in some cases I don't want the 3rd tile and in other cases I don't want 2nd nor 3rd. All depending on different session variables that I will populate from a database.

Offline

#2 14-07-2014 00:28:26

PierreUnge
Contributors
From: Malmö, Sweden
Registered: 30-06-2013
Posts: 2

Re: Dynamic sidebar possible?

After some dissecting I was able to modify the array and got it sorted. smile

Offline

Board footer

Powered by FluxBB