0

HTMLFrameMojit information is missing ?

Hi All !

In the Mojito Developer Topics --> Framework Mojits --> HTMLFrameMojit part : 
The "Body" mojit appear we don't know how :)
[ {  "settings": [ "master" ],  "specs": {   "page" : {    "type" : "HTMLFrameMojit",    "config": {     "deploy": true,     "title": HTMLFrameMojit Example with Children",     "child": {      "type": "Body",      "config": {       "children" : {        "nav": {         "type": ""Navigation"        },        "content": {         "type": "articleBuilder"        },        "footer" {         "type": "Footer"        }       }      }     }    }   }  } }]
Perhaps, HTMLFrameMojit handle the "Body" mojit automatically ?
Could you provide a lot more info ?

Thanks a lot

by
1 Reply
  • Hi Ben,

    The "Body" mojit is not a built-in mojit but a custom mojit.

    Let's assume an application as follows:

    -- application-root
      -- mojits
         -- MainMojit
         -- Child1ofMain
         -- Child2ofMain

    And let's also assume that you MainMojit has the main content of the body (html body element) and Child1 and Child2 will be further children of MainMojit.

    The application.json, in this case, will look as follows:

    [
      {
        "settings": [ "master" ],
        "specs": {
          "main_ui": {
            "type": "HTMLFrameMojit",
            "config": {
              "child": {
                 "type": "MainMojit",
                 "config": {
                   "children": {
                      "c1": { "type": "Child1ofMain" },
                      "c2": { "type": "Child2ofMain" }
                   }
                 }
              }
            }
          }
        }
      }
    ]


    If you don't need Child1/2, remove the "config" of "MainMojit" and just do ac.done(...) in MainMojit controller-index.

    If you want children content in MainMojit, in main-mojit controller-index do ac.composite.done(...) and in its view do have {{{c1}}} and {{{c2}}} wherever you want the contents of Child1/2 to appear.


    --
    Happy Hacking,
    Gaurav Vaish
    www.m10v.com
    0

Recent Posts

in Yahoo! Mojito