Multiple __layouts

16 views
Skip to first unread message

Hasan Yousef

unread,
Dec 29, 2013, 8:38:33 AM12/29/13
to part...@googlegroups.com
Hi Peter,

my question is: Do I need to load my Javascript files in all the layout I'm using, or there is a way to load common javascripts automatically in all __layouts in the application.

Regards,
Hasan

Peter Širka

unread,
Dec 29, 2013, 10:35:50 AM12/29/13
to part...@googlegroups.com
Hi Hasan,

You must manually add your scripts into all layouts :-)
I suppose that you will not have many layouts.

Thanks.

Hasan A Yousef

unread,
Dec 29, 2013, 2:16:07 PM12/29/13
to part...@googlegroups.com
Thanks, I've 2 layouts only :)

Hasan A Yousef

unread,
Jan 4, 2014, 1:39:10 PM1/4/14
to part...@googlegroups.com
Hi Peter..

I understood there are 2 ways to handlemultiple layouts in partials, one of them worked fine with me, the other did not, do not know why, and liked you to know.

1. The one worked fine, is: going to the view file, and write at the top: @{layout('_layoutStartup')}
2. The one that did not work with me, is directing it in the controller, as:
function view_homepage() {
var self = this;
        self.layout('_layoutStartup');
self.view('homepage');
}


Regards

Hasan A Yousef

unread,
Jan 4, 2014, 1:39:30 PM1/4/14
to part...@googlegroups.com

Peter Širka

unread,
Jan 4, 2014, 1:49:52 PM1/4/14
to part...@googlegroups.com
Hi Hasan,

In background @{layout()} === controller.layout(). I tested your problem and all it works properly.

Please send me an example.
Thanks :-)

Hasan A Yousef

unread,
Jan 4, 2014, 3:17:44 PM1/4/14
to part...@googlegroups.com
sorry Peter, it looks I was having a typo error, both options worked fine now :)

Thanks alot
Reply all
Reply to author
Forward
0 new messages