0

How to specifying doctype and bodyclass within HTMLFrameMojit

Hi,

How can I specifying the doctype and bodyclass within HTMLFrameMojit?
For instance: I'm trying to set up a webpage that uses yui3 modules. In order to look well, the bodyelement needs the yui3-skin-sam class. I can set this up by JS, but is seems to me it's better to place this code in application.json. I can't find it in the documentation...

Regards,
Marco

by
5 Replies
  • Unfortunately, currently the HTMLFrameMojit doesn't allow you to do add a class to the body element.

    What you can do is copy the HTMLFrameMojit that comes with Mojito source into your app's  'mojits' directory and then modify the views/index.hb.html, so that the body element has the class 'yui3-skin-sam'. HTMLFrameMojit is just another mojit (you could create your own frame mojit, too), so your local copy of HTMLFrameMojit will simply override the HTMLFrameMojit that comes with Mojito.

    The following instructions might speed things up for you:
     
    1. git clone https://github.com/yahoo/mojito.git
    2. cp -r mojito/lib/app/mojits/HTMLFrameMojit <your-app-dir>/mojits
    3. cd <your-app-dir>/mojits/HTMLFrameMojit/views
    4. Edit 'index.hb.html' so that the 'body' element has the class 'yui3-skin-sam'.
    5. Run your app. 
    0
  • All right,

    That will do. 

    Thx again,

    Regards,
    Marco.


    QUOTE(Me @ 27 Sep 2012 11:58 PM)
    Unfortunately, currently the HTMLFrameMojit doesn't allow you to do add a class to the body element.

    What you can do is copy the HTMLFrameMojit that comes with Mojito source into your app's  'mojits' directory and then modify the views/index.hb.html, so that the body element has the class 'yui3-skin-sam'. HTMLFrameMojit is just another mojit (you could create your own frame mojit, too), so your local copy of HTMLFrameMojit will simply override the HTMLFrameMojit that comes with Mojito.

    The following instructions might speed things up for you:
     
    1. git clone https://github.com/yahoo/mojito.git
    2. cp -r mojito/lib/app/mojits/HTMLFrameMojit <your-app-dir>/mojits
    3. cd <your-app-dir>/mojits/HTMLFrameMojit/views
    4. Edit 'index.hb.html' so that the 'body' element has the class 'yui3-skin-sam'.
    5. Run your app. 
    0
  • Is it still true for current version of mojito? I'd like to add yui3-skin-sam class to the body tag and also add some meta element to a header.

    Regards Darek

    0
  • Hi,

    Starting with Mojito 0.6 you can create your own frame mojit. This will let you make whatever frame you need to. Details here: http://developer.yahoo.com/cocktails/mojito/v0.6/docs/topics/mojito_frame_mojits.html#creating-custom-frame-mojits

    Drew

    0
  • Hi,

    I copied and modified

    frame_app example https://github.com/caridy/Mojito-Apps/tree/master/frame_app

    (added "app.js", removed some handlbars expressions from IntHTMLFrameMojit/index.hb.html

    because ac.intl.lang("some string") returns undefined, Y.mojito.version is not set, in order to render

    meta expression you must add meta proprerty to data object )

    It works, except one thing - cookie addon ie I can't set cookie in "child" mojit controller eg. BodyMojit

    ac.cookie.set('body', 'some cookie');

    while I can do it in in "parent" ie "IntHTMLFrameMojit controller

    ac.cookie.set('intlhtmlframemojit', 'some cookie');

    0

Recent Posts

in Yahoo! Mojito