Step 2 - editing include files
Previous  Top  Next

'Include' files allow you to re-use sections of your website that are repeated on several pages. Instead of copying text and then maintaining the same text in many pages, you can put all that text in a special file, and simply put a link to the file in your pages.

The files are called 'template' files, and they have the extension '.inc'. In the sample website, you'll notice that there are three files:

index.html
header.inc
footer.inc

If you take a look at the text at the top of index.html in the editor, you'll notice the line:

<<header.inc>>

When MacroHTML encounters this when you build your html file, it replaces this with the text it finds in 'header.inc'. It does the same with the
<<footer.inc>> file that is referenced at the bottom of the page.

In fact MacroHTML does exactly the same process when it reads header.inc - it looks for include directives (files within << & >> brackets) and substitutes their text in place of the directives. So one include file can include another, and another etc.

Include files are very useful for menus and can be used for much of the site, except the area where your contents change on a page by page basis.

For example:

<<header.inc>>
<<menu.inc>>

my specific page based menu options could be here

<<main_page_layout.inc>>

page text page text page text page text page text page text 

<<copyright.inc>>
<<footer.inc>>

<<Prev Next>>