BYU Home page BRIGHAM YOUNG UNIVERSITY  
Search BYU 
The Beauty of Include

Learn how to use include effectively in your ECEn web pages.

Basic Includes
Here is some ECEn XML "code" to show you how includes work:

[image]
There are two XML files here:
The blue XML file is the XML web page including a few files.
The green XML file is one of the files included in the blue XML web page.

To use 'includes' in your ECEn XML web pages:
1
Just as in the example, you'll need two separate XML files: one to include files and one to be included.
The file you are planning to include does not need its own .phtml file. In most cases, the included file does not have all the pieces required to stand on its own as an XML page.
2
Create the XML file to be included. You can create any content you want within this file. Here are a few guidelines:
When placing a menu, news box, or a single section within the included file, make sure that the <menu>, <news>, or <section> is the outermost tag in the included XML file.
If the content that you want to include doesn't have a natural outermost tag around it, like the sample above, then you will need to surround all of your content with <to-be-included> tags. This is necessary because all valid XML documents have one outermost tag.
For more details about outermost tags and valid XML documents, have a look at the General XML Fundamentals page.
3
Now, in the XML file you want to include your newly created XML file in, create <include> tags and within them, specify the XML file which you want to include.
You can specify a relative or absolute path, or a full web address, to your included XML file. If the XML Template Engine can't find the file or if there is an error in the included file, your web page will render without the included file.

For more information about how the <include> tag works, check out the ECEn XML Template Reference or email the ECEn Web Team.

Common Task Downloads


Maintained by The ECEn Web Team (other formats). Based on this XML and ver. 3.7 of the ECEn web templates.
Copyright © 1994-2005. Brigham Young University. All Rights Reserved.