Wednesday, February 27, 2008

OS: passing params to views..

var my_params = {
thumUrl : thumb
};
if(viewer != null){
document.getElementById("some_id").onclick = function(){gotoCanvas(gadgets,my_params);};
}

/*********************************************************/
//function definition...
function gotoCanvas(gadg,params) {
var canvas_view = new gadg.views.View("canvas");
gadg.views.requestNavigateTo(canvas_view, params);
}

/*********************************************************/
retrieve this on canvas page using :
// name matches the myparams variable declared on top...
var xx = prefs["thumUrl"];

OS: content navigation

[content type="html" view="profile"]
[!--[CDATA[ [h1]Profile[/h1][br /] ]]--]
[/content]
[content type="html" view="canvas"]
[!--[CDATA[ [h1]Canvas[/h1][br /] ]]--]
[/content]
[content type="html" view="canvas,profile"]
[!--[CDATA[ [h2]This shows up in canvas and profile views[/h2][br /] ]]--]
[/content]
[content type="html"]
[!--[CDATA[ [h1]Default[/h1][br /] [h2]The content in this section only shows up if no other content sections are applicable[/h2][br /] ]]--]
[/content]


Note : replace all "[" with "<" and "]" with ">"