There have been several (old) discussions in the forum that ask for the feature for generating the sitemap tree’s collapsed by default. Unfortunately Axure (after 2-3 years of requests) has not added this feature.
I am well aware of the hack that Matt Howell created. It seems however that this hack does not work on V7. I’ve tried my hand at looking at the sitemap.js file and hacking it myself but have had no luck.
Anyone else had any success generating prototypes with all sitemap trees collapsed by default?? I know there are some VERY smart cookies out there who have found some awesome Axure hacks. Major brownie points for anyone who has figured this out
Here’s something this hopefully is helpful. I took a look and saw that the “minus” button that collapses the sitemap just calls a ‘collapse()’ function.
In pages where you want to collapse the sitemap by default, put this in the OnPageLoad event:
Open link in current window: “javascript:void(window.parent.collapse())”
Unfortunately you will briefly see the sitemap before the page loads. Instead if you’re fine modifying your sitemap.js, try putting collapse() at the very end of the file as this script is run in the sitemap frame nor will it be dependent on your prototype loading.
That is a neat hack, I will definitely have to remember that. However is simply minimizes the entire sitemap. Instead I’m looking to collapse the sitemap nodes.
That worked! Kinda… it minimized all of my nodes, but it gave me the error "File Not Found
url : /16.54.19/$(%27.sitemapMinus%27).each(function()%7Bthis.click()%7D) "
Maybe I inserted it into the wrong spot? Thoughts?
So close… I inserted “$(’.sitemapMinus’).each(function(){this.click()})” into the sitemap.js file under “$(’.sitemapPageLink’).click(node_click)” and it is correctly collapsing the nodes when I generated the HTML (my happy dance was pretty impressive) but when I published it to AxShare they were expanded.
I also tried to enter it in as a onpageload event with javascript:void but that didn’t work either.
Unfortunately, since the page is loaded into an iframe on the sitemap page, this won’t run until that page is loaded meaning you’ll see the sitemap, then when the page loads it will collapse.
I took a look on the Version 8 sitemap and I see the problem you’re referencing. It will look like everything is collapsed, but if you open a top level folder/page the children will be expanded even though the icon indicates the collapsed state. I imagine you’d have to write the script to start bottommost child nodes and click your way up the tree to the top level nodes.
The sitemap is mostly nested unordered lists so it wouldn’t be a terribly difficult script to write, but it’s a little too tedious for me to bother with. Sorry