Skip to content
  1. Extras
  2. ModTree

ModTree

With this component, you can link resources of your site with each other and show them on page as a tree.

Make links between resources on CMP.

See result on live demo.

When the page loads, start search is performed for: &queryLinks=1 (default) - linked resourcesfor &parent (default current page), &queryLinks=0 - child resources for &parent.

Then, when you click on the resources icons, searches for related resources of them.

When you click on resource the resource content is displayed.

Uses AJAX. JQuery not required.

Examples

Display child resources

&queryLinks=0. Display child resources of resource 7 on start search.

modx
[[modTree?
  &parent=`7`
  &limitList=`5`
  &queryLinks=`0`
]]

Display linked resources

Display related resources of resource 15 on start search.

modx
[[modTree?
  &parent=`15`
  &limitList=`5`
]]

Snippet parameters

Result parameters

NameDefaultDescription
&tplOutertpl.ModTree.outerMain template
&tplListtpl.ModTree.itemListTemplate for start items
&tplTreetpl.ModTree.itemTreeTemplate for childs branches on tree
&tplSearchFieldtpl.ModTree.itemSearchFieldTemplate for search fields
&tplButtonstpl.ModTree.paginateBtnsTemplate for paginate buttons
&sortBymenuindex
&sortDirASC
&limit0Limit on tree for child branches
&limitList15Limit for start search
&contentIdPrefixmodtree-Prefix of ID for content fields. In case using two or more snippet on page you must use other &tplOuter with other $contentIdPrefix. Fields can be placed anywhere on the page, even outside of the &tplOuter
&customCss01 - not linked component CSS. If you use your own styles you may disable component CSS

Search parameters

NameDefaultDescription
&queryLinks1Determines the start search. 1 - related resources. 0 - child resources.
&parentcurrent resourceResource for start search
&queryForce1Determines whether to perform a start search. 1 - do start search, 0 - search only on search button click
&linkWay0Link direction. 1 - master to slave. -1 - slave to master. 0 - both way
&searchFieldspagetitle,contentSearch fields. String with comma separator. To disable - &searchFields=``