Include custom scripts in design view for content pages

Hi @patrick,

I believe this one is for you.

I’ve got this simple formatter.

dmx.Formatter('string', 't', function (key, options) {
    if (i18next.isInitialized) return i18next.t(key, options);
    else return key;

But the UI won’t recognize it so I have to turn off App Connect mode in the browser to view the text.


Any way I can make sure the needed js code is loaded correctly so the internal browser renders the result?

Additionally, any way to summon the internal browser console?

Is the formatter code on the page you are editing or are you editing a content page and the include is on the main page?

On layout as it’s a global formatter. I moved it into the content and I saw it worked then.
Can this be improved?

Actually @patrick and @George wouldn’t it make sense that when using the internal browser on a content page it renders besides the content page the layout plus any other partials?

Maybe you could even add a light overlay and block editing for all the page except for the content itself. And when clicking outside the content like the layout or other partials it opens or diplays the files for them.

Bubble follows a similar approach as it makes things more visual by loading the whole page. People can understand better how their page will look like without having to open the external browser.

@patrick, do you consider this to be a bug? -> Custom formatters defined in layout not available to content pages in the internal browser?

Post is still in the “how-to” category but it seems to be a bug or candidate for a feature request at the very least.

We include all the framework scripts and css to the design view, but custom scripts added to the main page are not being included in the design view of the content page. It is not a bug, since the functionality was never implemented. It is certainly a candidate for a feature request, this should be implemented and we will certainly look on how we can do this.

1 Like

Thanks for confirming Patrick. I’ve changed this to feature request.

If you need to look into this I would suggest a full pass to the whole “layout-content” design view concept to figure a way to show layout and partials in the same design view(even if you can’t edit them from a content page).

It would be nice to be able to load a content page into the design view and see how everything fits in.