I am working on a modular web app and using Server Side Include (SSI).
Could someone share the best practice of using Server Connect (SC) on SSI pages? I am running into trouble when I am loading the SSI pages across various head pages. What is the best practice?
Is it:
Option A:
Adding the SC to the main page and the SSI loads it from there?
What would be the path to the SC? Would it be {{SC}} or {{someID.SC}}?
Option B:
Adding the SC to the SSI page and load it from there.
What would be the path to the Service Connect? Would it be {{SC}} or {{someID.SC}}?
Option C: …?
Also some clarification/documentation on how to indicate hierarchy between main page and SSI pages would be welcome.
For example, how is the main page identified in the code?
With these: <base href="..."> and meta name="ac:base" content="...">
Or on the SSI page with this: <!-- Wappler include head-page='main.php' [...] >
I do this all the time (using PHP)… you can put the SC anywhere and the route to it is always {{SC}}.
In the header comment, if you change the name to be your main page (so for me index.php) then all the effects of your css should be visible in Wappler.
Thanks @Antony that helps a bit indeed!
However I am still struggling to understand the SC across various pages.
Maybe I can reformulate my question:
Is it possible to use a SSI page (that loads data through a server connect) across various head pages (without embedding the server connect on each head page)?
But when he SSI is loaded on a different head page, it tries to find the SC on the head page instead of the “local” SSI page.
When I check with “dmx.app.data” the SC is not found.
How can I ensure that the SSI page loads the SC on that same SSI page instead of looking for it on the head page?
Sorry I am not sure I understand what you are asking exactly. When SSI is used on the page - the code is injected directly there, there are no head pages etc. Are you sure you are not confusing SSI with Content Pages maybe?
Better provide an example of what exactly are you trying to achieve, as your explanation is quite confusing.
You can remove the Wappler comment tags from the top of the include code. These are only needed for proper rendering them in design view. This won’t break the functionality of your site.