[MKDoc-dev] [1.6 bug] Using self/parent/parent for detecting where one is in the document hierarchy

Chris Croome chris at webarchitects.co.uk
Thu Feb 23 14:56:39 GMT 2006


Hi

If some functionality is needed based on where one is in the document
hierarchy then using things like this mostly works: 

  petal:condition="true:  self/parent/parent; 
                   true:  self/parent/parent/children" 

Or:

  petal:condition="false: self/parent/parent/equals ancestor;" 

But if a document doesn't exist when testing for a parent/parent (for
example when a template designed for grandchild pages is used for child
pages) then there is an internal server error rather than Petal
returning false and things like this are written to the apache logs:

  [PETAL ERROR] Cannot find value for 'equals' at '/self/parent/parent':
  equals cannot be retrieved
  (current value was undef, near self/parent/parent/equals ancestor) at
  /usr/lib/perl5/site_perl/5.8.6/Petal/Hash/Var.pm line 125

Which is rather inconvient...

Chris

-- 
Chris Croome                               <chris at webarchitects.co.uk>
web design                             http://www.webarchitects.co.uk/ 
web content management                               http://mkdoc.com/   


More information about the MKDoc-dev mailing list