How can I do includes like the header or footer?

Now that it’s fully released, I’m working on a new project with Wappler but have already hit a problem.

I use files for things like header, footer, menu, etc. and then include those in the pages. How can I do this in Wappler? I can’t find anything to do with includes anywhere.

I’m using PHP as the server model.

We are actually working on this right now! Hope to have it included in the next update.

It will go like this:

  • you will be able to select (or move the current content to) server side include file for your header (before body tag) and footer (end body and rest)
  • you will be able to select a part of the page in the App Structure or DOM Tree and create and move to server side include file
  • when new components are added to a page that has header as server side include - it will add the needed js and css files directly in that file.
  • in design view server side includes will be fully rendered so you see their contents but won’t be editable. You will need to open the include file directly to edit it

Server side includes will be implemented depending on the server model you choose for your project. If it is PHP they will be done with PHP require_once code. If it is ASPNET/ASP it will be SSI include: <!-- #include file="somefile.aspx" -->

Will that satisfy your workflow or do you still miss something?

4 Likes

Will that work also for you @psweb and @t11 - we discussed it before in the Beta forum and it seems to me a good way to handle server side includes. After we implement those we will also move to working on client side view renderings/routing with App Connect routes and views.

Personally for me that sounds like the perfect way to go, the only issue i forsee ever with this is getting the includes file in exactly the right place in the code. But with the DOM treee maybe that will be simple enough. :slight_smile:

1 Like

As @psweb says, as long as the in-page includes can be positioned accurately it seems absolutely the right way to go.

1 Like

That sounds like a perfect solution. I don’t actually need it to be that complex, I’m happy putting in a simple include_once manually but just didn’t how it should be done so Wappler still renders everything correctly.

I’m slightly concerned about the lack of documentation, tutorials and finished features now it’s live and my year of license has begun ticking. SSI is a core element but the documentation is even more important. Are you considering reset the year for backers when all this is finished? It feels like it’s still in RC stage rather than complete.

2 Likes

I agree, it must be considered “final version” only when it meets the specific promises in the crowdfunding (e.g. app builder).
The missing documentation is a serious lack.

Documentation is already done, we are polishing it now and it will be available in the next few days.

1 Like

4 posts were split to a new topic: The Wappler’s philosophy

Do you have documentation link?? I am in this point

If you are creating static HTML pages, you could choose to create your own elements as in

and