Macro code problem

Hi

I am currently having an intermittent problem with some code I have done for a sitemap on one of our sites. The code is attached.

To summarise, the code is use to present the title and url for each folder in levels 2 to 4 of the site. It checks to see if the value of the URL is #, which in this case denotes that it is an external link. If it is an external link it then retrieves the value of rx:url from the external link content type (done by using $navon.getProperty(“nav:landingPage”).node.getProperty(“rx:url”).String).

This works fine with levels two and three but at present doesn’t work for level one. The following message appears:

Problem assembling output for item: 5-101-9781 with template: auSnNavSitemap exception: Property rx:url not found see log for stack trace

I mentioned this is intermittent because it was working fine before I went on leave a week ago! Is there a problem with the code that is causing the intermittent problem?

Thanks and regards

Richard

Have you verified that the item defined by the GUID (5-101-9781) is in fact an external link?

It seems somewhat risky to me make the leap from “#” to “external link”, there are any number of reasons why a link could come up “dead” like this.

Generally speaking, it’s safest call call “hasProperty()” before “getProperty()”, and only get the property when you’re sure that it exists.

Dave