[coldbox 3.8.1] defaultView setting in custom module

Hello everyone!

Firstly I would like to say a warm “hi” to the community, I have just recently started my exciting adventure with coldbox, and it’s my first time on this group. Please be patient with me :slight_smile:

To the point: I created a new module and I am having problems setting the “defaultView” option in the layoutSettings struct inside my module configuration:


layoutSettings = { defaultLayout = "mainlayout.cfm", defaultView = "test_view.cfm" };

When I reload the page, I get an error:

Application Execution Exception Error Type: missinginclude : 0 Error Messages: Page //views/default/index.cfm [C:\(...)\slawek_contentbox\views\default\index.cfm] not found

The weird thing is that the defaultLayout setting works correctly and loads my layout (mainlayout.cfm).

What is interesting, if I check in my handler for event.getDefaultLayout() or event.getDefaultView() they both return the main application default values set in Coldbox.cfc

If I set the view inside my handler (default.index) using event.setView(view=“test_view”), the view is rendered correctly. If I set the default view inside the handler using event.setDefaultView(“test_view”) it works correctly too.

It seems that only the defaultLayout setting overwrites the main coldbox settings but not the defaultView.

Would someone be so kind to check if this functionality works for them?

best regards,

Hi Slawek and welcome to Boxlandia! I don’t know the answer to your question right off and I haven’t the time at the moment to give it a test. I pinged Luis to see if he can help. In the mean time, don’t be afraid to bump your thread in a day or so if no one replies. Sometimes it gets lost in the inbox :slight_smile:




Unfortunately, a default view on a per module basis does not work. I guess we never completed that. I would encourage you to fill out an issue for it and we will address it. Or if you feel right for the challenge, you can submit a pull request :slight_smile:




ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com