# The Basics

When routing is enabled in the Construct Settings, there are two ways routing occurs in Construct 2.

  1. If the ExpressionEngine URI matches a Node full route
  2. If the ExpressionEngine URI matches a route in Construct’s routing config.

When a node is matched, the specified template from the Node is served. When a route config is matched, what you have specified for that route will run.

# Route Variables

Construct makes certain variables available when it matches a route or a Node.


If the route is being served by the config file but does not match a node, and the values are not set by the config (where applicable), the values of these items will be set to false.


The ID of the currently matched Node.


The ID of the Tree from the currently matched Node.


The parent ID of the currently matched Node. 0 if Node has no parent.


The level of the currently matched Node.


The name of the currently matched Node.


The slug of the currently matched node — which will be the same as the last URI segment.


The external link field of the currently matched Node.


The full route of the currently matched Node. Example: about/executives/ceo.


The entry ID of the selected entry for the currently matched Node. When using Construct to create pages, this is how you connect everything together. You can feed this tag into the entry_id parameter of an exp:channel:entries tag pair to serve the specified Node entry.



Whether the currently matched Node is set to output in Menus.


Whether the currently matched Node is set to paginate.


The pagination amount set for the currently matched Node.


The channel(s) chosen for listing. If there is more than on channel, they will be pipe delimited.

	{if construct_route:node_pagination}

# How the Extension Hook Works

The Construct extension uses the core template route hook. When you load any URI in ExpressionEngine, the core template route hook is run.

Construct checks to see if there is a Node with routing enabled that matches the current URI and has a template associated with it. It also checks to see if the route is a match for any config file routes.


It is recommended that you completely disable the ExpressionEngine build-in Pages module since it also has to run queries to see if the current URI is a match for the page. The routing functionality of Construct is intended to replace the first party Pages module.

# Serving Templates

Construct can serve both regular and hidden templates, but it is recommend that you use hidden templates so they can’t be accessed directly — apart from a Construct route — and therefore serve duplicate end-points or run into errors because Construct Route Template Tags aren’t available.