Latest blog entry: cakePHP

Here are some tips from newbie to newbie, with problems and their solutions as I came across them whilst testing the cakePHP framework. Read more... (1 Comments)

Checking if a document has children in the tree

Ive just created my first snippet. I am working on a new template because Ive flogged this one to death. One of the things I wanted to integrate was a sub menu this time instead of using the CSS menu you see here. My first thoughts were "What about if the current document has not got any child documents"? This made me start work on the snippet that checks to see if the current document has children:

If it does then it will output a chunk of HTML which you define in the snippet call, otherwise it will output a different chunk of HTML. The chunk defined for where the document does has children simply calls Wayfinder in its simplest form. Wayfinder is a great snippet for creating menus.

If you are using this snippet, and have any feedback or problems, feel free to leave a comment.

Back to Blog index