Routes and layouts

25 views
Skip to first unread message

SLingle

unread,
Oct 6, 2016, 11:37:52 AM10/6/16
to ColdBox Platform
'morning all,

I'm trying to add a route to my application with no layout.  If I add it in Routes.cfm with the following: addRoute(pattern="/api/:handler/:action?/", viewNoLayout=true);  or addRoute(pattern="/api/:handler/:action?/, noLayout=true);  I'm still getting the layout on the page. I've done a fwreinit just to be on the safe side.  I know that it's getting to the correct route I'm just not sure why I'm getting the layout.  I can go into the handler for that action and set event.noLayout() and it works - no layout.   I want to be able to have/show the layout based on the route.   Am I missing something basic here or is this something bigger?

Thanks
Scott

SLingle

unread,
Oct 6, 2016, 11:39:16 AM10/6/16
to ColdBox Platform
sorry...forgot the conventions, it's been a while since I posted....it's [coldbox-4.2.0]

br...@bradwood.com

unread,
Oct 6, 2016, 4:46:16 PM10/6/16
to col...@googlegroups.com
The viewNoLayout parameters only seems to apply if you're specifying a view right there in your route.  It doesn't look like what you're wanting is directly possible, but what you can do is add a flag of your own like noLayouy=true which will turn into an rc variable, which you can later check via an interceptor or something and call event.noLayouyt() when necessary].

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: br...@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com 
 
 
--------- Original Message ---------
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/ff4972a1-4482-4da2-8610-ea3a2311a695%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages