Supporting files not added to document head when inserted from an include

I noticed a strange thing happening with my navigation not getting the active class applied when navigating from one nav item to another, here are the steps to reproduce.

  • Create a new page
  • Add Bootstrap CDN
  • Add AppConnect
  • Right click App in the AppStructure panel and select Headers, Brand Menu Social Dark, it inserts the navigation as expected with the supporting files <script type="text/javascript" src="dmxAppConnect/dmxBootstrap4Navigation/dmxBootstrap4Navigation.js"></script>
  • Add a link to all the navigation elements
  • Select the entire Header element in the AppStructure panel and click Move to Include File
  • Make a new page
  • Add Bootstrap CDN
  • Add AppConnect
  • Right click App in the AppStructure panel and select Server Side Include, it inserts the navigation as expected but the supporting files <script type="text/javascript" src="dmxAppConnect/dmxBootstrap4Navigation/dmxBootstrap4Navigation.js"></script> are never added to the document head.

Hope this makes sense @George

Yes it does makes sense - but the questions is what will be a logical solution.

As includes are now separate files and they just get included. We have no record on which components there might have being used so we can reinclude them.

We do keep track of the current used frameworks so we can reinclude those - but tracking all the possible components might be a bit of overkill.

So ideas of implementations are welcome :slight_smile:

I have to admit @George even while asking the question i was wondering to myself how you would possibly even try and find a way around this issue, because I can understand that it would be almost impossible to cover every possible scenario of what could possibly be used inside an include file.
I will have to have a good think about this one to see if i can come up with any ideas that might work for implementation.
The problem from the user end lands up being that in a scenario when adding navigation to an external exclude file which i am sure many people would do, then when you call that include into each new document you create, the only way of calling in the supporting .js file would have to be adding a navbar, then deleting it before adding the include, and that same issue would go for hundreds of different elements one could use.
Is the html commented line in the include file only used for rendering purposes, otherwise if that same comment included <!-- Wappler include appconnect="local" bootstrap4="cdn" jquery_slim_33="cdn" js="dmxBootstrap4Navigation.js–> however i have no idea how this would work when the navigation could also be using formatters, browser, and 100 other things too.
@brad @ben any input on this one.