Downloads » Resources » UltimateParent

UltimateParent

  • Currently 4.75/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Votes: 4

UltimateParent 1.3

Bug fix to prevent infinite loop if parent never equals $top.

Works with MODx Version(s): 0.9.5
Submitted: May 19th 2007 | License: Public Domain | Downloads: 972

Return the "ultimate" parent of a document.

Description

Travels up the document tree to return the "ultimate" parent of a document. An optional argument in the snippet call can specify a document ID to act as the top of the tree if you don't want to go all the way up to the root. Another argument can specify the document whose parent you want, if this argument is not used the current document's id will be used.

Instructions

Copy the text of UltimateParent to a new snippet. Call the snippet with or without the optional arguments:

[[UltimateParent? &id=`45` &top=`6`]]

will return the ultimate parent of document 45, below document 6.

Previous Releases

UltimateParent 1.2

2006-09-17: Fixed bug where the getParent() query would try and use an Array (the entire result row from getParent) instead of the single id column value.

Works with MODx Version(s): 0.9.2.1, 0.9.2, 0.9.1, 0.9.0
Submitted: Sep 17th 2006 | License: Public Domain | Downloads: 893

UltimateParent 1.1

Initial Release

Works with MODx Version(s): 0.9.2.1
Submitted: Jul 2nd 2006 | License: Public Domain | Downloads: 913


Extras

No results found.


( back to top )