Find more Examples here

Content Types (FlexView-API)

Version reduced to minimal set of HTML Read Example Description


// Default content type
var contentType = "tour";

// available content types
var contentTypes = [

// grab first key/value pair out of query string (brute force)
var keyValue ="=");

// is key really called "contentType" and is this content type available ?
if ((keyValue[0]=="contentType") || (keyValue[1] in contentTypes)) {
    contentType = keyValue[1];

// find flexview api dom node
var tc = document.getElementsByClassName("oax-top-cont")[0];

// choose dom node to place content type menu in
var pb = tc.parentElement;

// create unordered list
var ul = document.createElement("ul");

// iterate over available content types to create a menu
for(var i=0; i<contentTypes.length; i++) {
    // create list element
    var li = document.createElement("li");
    // create text node with content type name
    var t = document.createTextNode(contentTypes[i]);
    // create element to link each menu entry to a content type
    var a = document.createElement("a");
    a.setAttribute("href", "?contentType=" + contentTypes[i]);

    // add it to list element

    // add list element to list

// create new div element
var div = document.createElement("div");
div.setAttribute("class", "container");

// insert new div into panel body just before flexview api node
pb.insertBefore(div, tc);

// add some explanation to the menu
div.appendChild(document.createTextNode("Please choose a FlexView API content type:"));

// add list as menu

// flexview API config object
var conf = {
    frontendtype:   contentType,     // content type chosen by query string
    zoom:           11,
    center:       [ 10.292, 47.546 ]

// create flexview API
var fvp = oa.api.flexviewpage( conf );