By continuing to use this site, you agree to the storing of first- and third-party cookies on your device to enhance site navigation; analyze site, product, and service usage; and assist in our marketing and promotional efforts. Cookie Policy

 
Skip to Content

Includes

Includes are small, simple files that insert content into another file when published. Use include files to deliver the same content on multiple pages. For example, headers and footers often use the same content on every page of the site. To make a change, edit the include file, rather than editing every page. 

Most includes are text or source code files with an extension of .inc. You can also create an include with variables to be called by a TCF

Find include files in a folder named _resources/includes/, or similar. Publish the include file to send updates to pages on your live site.

AppearanceLink to this section

Include files are generally styled the same across the site and hard-coded to appear in a particular location on your page. For instance, side navigation files display in the same location on every page and their appearance is not editable through a page’s editable regions. Some templates allow you to change how an include file is used on that page in Properties.

A screenshot of a page. The list of links to other pages in the section, in the left-hand column, is circled in orange.
This side navigation file shows all pages in the "Athletics" folder when published.

Because every OU Campus implementation is unique, the specifics of how your includes look and function might differ, but these basic principles apply to most implementations (if you have a custom solution, you'll need to consult with an administrator or the developer notes for your implementation).

One of the most common uses for include files is navigation, or the links on a page that point to other pages in the section or site. The navigation file is usually located in the folder for the site or section and is named _nav.inc or _sidenav.inc.

When you create a section, the navigation file is also created.

When you create a page, select "Yes" to "Add Navigation Item." This automatically creates a new navigation file or adds a link to the bottom of an existing file. 

Edit

Edit navigation files using the What You See Is What You Get (WYSIWYG) editor. You don't need to worry about formatting; publish the file to apply styling.

Edit a navigation file like you would edit a page. You can,

  • insert, move, and delete links;
  • edit the file path for the link; and
  • edit the link's display and title (alternative) text. 

Insert a link in the navigation file, as follows:

  1. Go to Content > Pages to find the folder that contains the new page.
  2. Click the folder name to open it.
  3. Locate a file named _nav.inc, or similar.
  4. Click the file name to open it.
  5. Click in the list of links where you want to add the new link.
  6. Press Enter.
  7. Type in the text of the new item link.
  8. Highlight the text.
  9. Click Insert/Edit Link Insert/Edit Link icon in the WYSIWYG toolbar to open the "Insert/Edit Link" box.
  10. In the "URL" field, click the file chooser URL File Chooser icon.
    • From file chooser, click the name of the new page.
    • Click Insert.
  11. In the "Title" field, enter the name of the page you're linking to.
    • "Title" text appears when someone hovers over the link and is used by screen readers. This is important to meet accessibility compliance standards.
  12. Click Save.
  13. Click Publish.

Navigation Editor

If you prefer to edit navigation files by dragging to reorder items and typing in form fields, use the navigation editor. Open a file with the filename extension .ounav to use the navigation editor. You can,

  • add, move, and delete links;
  • edit the file path for the link; and
  • edit the link's display text. 

The navigation editor is intended for use with secondary, not main, navigation. To determine if the navigation editor fits your needs, contact our help desk.


Add a link in the navigation file, as follows:

  1. Go to Content > Pages to find the folder that contains the new page.
  2. Click the folder name.
  3. Locate a .ounav file.
  4. Click the file name to open.
  5. Click +Add New.
  6. Type to provide the display text.
  7. In the "URL" field, click the file chooser URL File Chooser icon.
    • From file chooser, click the name of the new page.
    • Click Insert.
  8. Drag to reorder links.
  9. Click Save.
  10. Click Publish

Subnavigation

Use subnavigation, or nested navigation, to link to pages in sections above or below the current section.

Add an item and publish a  _nav.inc that is inside a top-level section. The top-level _nav.inc will automatically display a link to the new item on your live site.