How CARL's Includes System Works

CARL's includes system lets you define a block of HTML or PHP once and have it appear on every page that needs it. Your site navigation, footer, sidebar, and signup form all work this way. The content lives in a single file. Every page that references it pulls from that file at the time of generation. Change the file, regenerate your pages, and the change is everywhere.

How CARL's Includes System Works

What an Include File Is

An include file is a plain text file stored in your site_includes/ folder inside public_html. It contains whatever you want it to contain: HTML, PHP, JavaScript, a form, a widget, a navigation menu. There's no special syntax and no CARL-specific format. It's just a file with content, and CARL pulls it into your pages using a standard PHP include call.

How Templates Use Include Files

Every CARL page template contains PHP include calls that reference specific files in site_includes/. When CARL generates a page, it builds the complete PHP file from the template, writing those include calls into the output. When a visitor loads the page, PHP executes the include calls, and the content from each file is inserted at the correct position. Your navigation appears at the top, your footer at the bottom, your sidebar in the right column, exactly where the template expects them.

The Power of a Single Source File

Because every page references the same file, there is only ever one version of your navigation, one version of your footer, one version of your signup form. You don't maintain copies. You don't risk them falling out of sync. You update the source file, and every page on your site reflects the change on the next load. A site with 500 pages gets a navigation update in the same amount of time as a site with 5.

Include Files vs. Page Content

Include files handle everything that surrounds your content: layout chrome, site-wide elements, and reusable blocks. Page content lives in the page record itself. This separation is deliberate. It keeps your content clean and portable, and it keeps your site infrastructure manageable. If you ever change your navigation structure, you only need to change one file. Your page content is untouched.

Beyond Headers and Footers

The system isn't limited to structural elements. Because include files can contain any valid PHP code, you can use them to deploy interactive applications, lead-generation forms, booking widgets, and multi-step quote systems directly into any page. The same mechanism that puts your footer on every page can put a fully functional quote form on a specific page. For a full look at what's possible, see What you can build with CARL include files.

What do you think?

0 Responses

Free Membership

It's free. Log in instantly.

We won't send you spam. Unsubscribe at any time.

Related Posts