Adding AppConnect component in SSI

OS info

  • Operating System : Mac OSX 19.0.0
  • Wappler Version : 2.5.6

Problem description

If I add a component via UI inside a SSI it adds to the header the html code for double quote instead of the symbol and a few other characters.

If I had the components manually via code everything works correctly in the SSI. Calling the browser js via script tag.

If I do it via UI I get this which adds a string to the SSI header but it seems off.

<!-- Wappler include appconnect="local" is="dmx-app" bootstrap4="local" fontawesome_4="local" jquery_slim_33="local" id="i18n" components="{&quot;dmxBrowser&quot;:{}}" -->

<div is="dmx-browser" id="browser"></div>

And this:

Steps to reproduce

  1. Create a php SSI
  2. Add browser component

Sorry not sure what do you mean? What is added on which page and what do you think is wrong?

To the SSI top comment

image

This is supposed to be added there. Sorry, is it possible to explain a little more detailed what exactly is wrong on your page and how/when do you see/experience the issue?

Sure.

I am using a SSI to move all my translation functionality to a single file as it’s going to be on all pages. This SSI loads a JSON file that will depend on browser language and app name.

If I have my SSI like this the translation functionality works perfectly.
As you can see below I have called the dmxBrowser.js directly from the code via script tag.

However if I add to the SSI the browser component via the UI it adds some code about dmxBrowser to the commented initial line but I get an error on the console about browser component being unknown and the page is not translated.

All in all there seems to be an issue when adding a component to a SSI(php) via UI.

Thanks for the explanation.
Adding components in the SSI work the following way:

The component is added into the green comment tag.
The <script src="...component.js"> … does not get added on this page. It’s added on the main (head page) where this SSI was created on.

Ok. I see what you mean. That would explain this property then. For my case I had it blank as I wanted to reuse the SSI through all my pages.

image

But that would mean that I can’t reuse a php SSI with different pages? Doesn’t that defy a bit what SSI are meant for?

Wouldn’t it be more useful that if there is no Content Page defined for components to be added via script tag so that they are available to any page that includes this SSI?

In cases like this, you can indeed just copy the script tag in the SSI.
Maybe we can think of a better way of doing this through the UI.

1 Like