Header footer and includes

Hello Community,

I am back with wappler and started building my first page with index.php / header.php + footer.php as server side includes. I am using Bootstrap 5 local and added it with all 3 pages (index/header/footer) at first.

With Joomla 4 I was able to add includes with header at one place globally for all pages. Therefore my thought was, to activate Bootstrap only with my header.php. Since I will use my header on pretty much every page, I assumed Bootstrap 5 would be included for every new page along with my header.php.

Basically I am asking:

  1. Do I have to activate Bootstrap 5 for every new page or …
  2. Is there a way to apply something like Bootstrap 5 or else globally, so I don’t have to include for every new page

Welcome back @WatchThatCode :slightly_smiling_face:

There are a couple of ways of doing this. You can create an include file (_header.php is what I would usually do) and include that on all your pages. Or you can just let Wappler handle the Bootstrap integration. I often create a template page (_template.php) which I then duplicate when wanting to create a new page and this will have all the basic includes in it.

I’m sure there are other, and probably better, ways to do this but hope it helps.

To add to what @sitestreet has said,

Yes

Wappler includes the links to the support files every time you create a new page.

As an alternative, try using Node/Express which has a great templating system.

A bit old but may help:

Thank you :slight_smile:

Wappler will automatically add the frameworks selected in your project settings for every new html page you create in your project.

+1 for your tip…just found it :slight_smile: