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. INC files are not called by pages created from layouts (Layout Control Files [LCFs]).
Find include files in a folder named _resources/includes/
, or similar. Publish the include file to send updates to pages on your live site.
Your site may also use .ounav
files for section navigation.
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.
Because every Modern Campus CMS 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).
NavigationLink to this section
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:
- Go to Content > Pages to find the folder that contains the new page.
- Click the folder name to open it.
- Locate a file named
_nav.inc
, or similar. - Click the file name to open it.
- Click in the list of links where you want to add the new link.
- Press Enter.
- Type in the text of the new item link.
- Highlight the text.
- Click Insert/Edit Link in the WYSIWYG toolbar to open the "Insert/Edit Link" box.
- In the "URL" field, click the file chooser .
- From file chooser, click the name of the new page.
- Click Insert.
- 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.
- Click Save.
- 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, nest, 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 us via the CMS Support Resource Portal (login required).
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.