I am a newbie to CQ5 development, so I am just getting used to the CQ5 API's.
I have built many left navigation templates, using another CMS, where their were navigation api methods,that could tell me if a navigation link, was the current link, if it was an ancestor of the current page.
I have looked at the CQ5 Page and Node api's and cannot figure out which method or property will tell me if the page or node is the current page/node or an ancestor, I need to know this if I am going to build any type of Navigation that must indicate the current/ancestor link.
Does anyone have a sample left nav code they could share, tell me which API to use.
Thanks in advance..
You could use the default Navigation API. The OOTB navigation component also uses the same.
The simplest approach would be to just use currentPage.getPath() to get the path of the current page and compare it to the navigation link. Depending on how your navigation component get's it's list of links you may have to use startsWith or something like that for the comparision.