Problem in customizing the widget system in "html" mode

Hello Everyone,

There is a problem in customizing the widget system in “html” render-mode. The problem is that MoquiDevConf.xml is the last configuration file to be loaded by the system and hence we cannot override anything in that file, and that file has the following code section which prevents me from overriding DefaultScreenMacros.html.ftl. So in order to test my custom widgets I have to touch community code and comment-out that <screen-text-output .../> tag.

I’m not sure what’s the best approach here? Do we comment out this line, or change component loading-sequence, or maybe allow a dev-settings section to override specifically for the development environment? Or is it simply regarded as OK behavior to patch the core components (runtime) during development?

    <screen-facade boundary-comments="true">
        <!-- The default conf file has a macro location defined for html already, but this is an example of how to
            refer to a file to override the default macros. -->
        <screen-text-output type="html" mime-type="text/html" macro-template-location="template/screen-macro/ScreenHtmlMacros.ftl"/>
    </screen-facade>
1 Like

I certainly don’t understand the problem fully, but if I had that issue, I would just change the line of code in MoquiDevConf.xml during development, because it only applies to development environments.

There probably is a more thorough solution, but I don’t know what it would be at the present time.

Hi Michael,

Well yeah that’s what we’re doing at the moment but it makes the development experience a little unpleasant.

Everyone of our team members needs to remember during development to comment this line out, and as per my understanding the basic idea of MoquiConf.xml is to allow modifying the environment without touching community code (which is great), but this case seems to be an exception.

So I just created a patch and automated applying it to the build system. It works but you know … maybe not an optimal way of doing things.

1 Like

Yeah I definitely get that. I could look into what the problem is more, but it would take some time that could be spent somewhere else. It’s probably a fairly simple fix.