Here's a recipe I created some time ago for setting different layouts for different routes, including no layout at all.
http://stackoverflow.com/questions/18198270/more-than-one-layout-wrapper-with-dancer-and-templatetoolkit Sent from my mobile. Please excuse brevity & typos. > On Sep 12, 2015, at 11:49 AM, Kadir Beyazlı <[email protected]> wrote: > > Hi John, > > Yes it worked as follow, thanks. > > template 'login', { path => param('requested_path') }, { layout => undef }; > >> On Sat, Sep 12, 2015 at 9:33 PM, John J. McDermott, CPLP <[email protected]> >> wrote: >> To unset it just for login, try >> >> get '/login' => sub { >> template 'login', { path => param('requested_path') }, undef; >> }; >> >> See >> http://search.cpan.org/~sukria/Dancer2-0.10/lib/Dancer2/Manual.pod#template >> >> I believe setting "layout" is global. >> --john >> >> >> On 9/12/2015 12:20 PM, Kadir Beyazlı wrote: >> >> Hi All, >> >> Following worked, but this time main layout was not loaded at other >> routes either. >> I want main layout not to be loaded for only /login route. >> >> get '/login' => sub { >> set 'layout' => undef; >> template 'login', { path => param('requested_path') }; >> }; >> >> On Sat, Sep 12, 2015 at 9:15 PM, Kadir Beyazlı <[email protected]> >> wrote: >> >> Hi All, >> >> I tried following but it did not work, I need something similar to it. >> >> get '/login' => sub { >> config->{layout} = undef; >> template 'login', { path => param('requested_path') }; >> }; >> >> On Sat, Sep 12, 2015 at 9:01 PM, Kadir Beyazlı <[email protected]> >> wrote: >> >> Hi All, >> >> I think I saw solution at mails but could not find at my search so I have to >> ask here. >> >> I set main layout. >> But I don't want main layout to be loaded at route /login. >> Is it possible disabling main layout at route /login although I am using >> template in it? >> >> get '/login' => sub { >> template 'login', { path => param('requested_path') }; >> }; >> >> -- >> Kadir Beyazlı >> GSM : +90 535 821 50 00 >> >> >> -- >> Kadir Beyazlı >> Computer Engineer >> GSM : +90 535 821 50 00 >> >> >> >> -- >> John J. McDermott, CPLP >> Learning and Performance Consultant >> jjm at jkintl.com 575/737-8556 >> Check out my security blog posts >> Add an A for the Arts To STEM and get STEAM and a strong engine to move >> forward. >> >> _______________________________________________ >> dancer-users mailing list >> [email protected] >> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users > > > > -- > Kadir Beyazlı > Computer Engineer > GSM : +90 535 821 50 00 > _______________________________________________ > dancer-users mailing list > [email protected] > http://lists.preshweb.co.uk/mailman/listinfo/dancer-users _______________________________________________ dancer-users mailing list [email protected] http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
