Multiple Contexts with Wayfinder (MODX Revolution 2.x)

Body
Wayfinder is one of the most powerful menu systems found in any CMS. Combined with MODX Revolution contexts, it is even stronger.

Authored on

Framework

Code


[[Wayfinder?
    &startId=`0`
    &level=`2`
    &contexts=`backoffice,web`
    &scheme=`full`
    &outerTpl=`tpl.Wayfinder.outer`
    &parentRowTpl=`tpl.Wayfinder.row.parent`
    &innerRowTpl=`tpl.Wayfinder.row.inner`
    &rowTpl=`tpl.Wayfinder.row`                   
]]

Requirements

This works ONLY if you have done the following:

  • Added a site_url setting in the default system systems pointed to the "web" context domain name : http://www.domain.tld/ (don't forget the slash)
  • Added a site_start setting in each context pointing the context's home page
  • Added a site_url setting in each context with the domain for that context: http://subdomain.domain.tld/ (don't forget the slash)

Comments

The scheme will build a full url for each link based on the context setting site_url, in this way you can have multiple contexts in one menu.


Added to official MODX forums in response to an answer: forums.modx.com