You don’t have the id="visible" there to make it open some block..
if you have page structure like this:
container 1
|
|- document 1
|- document 2
|- document 3
container 2
|- document 4
|- document 5
|- document 6
You would set that document 1 for example in to Site Start in modx configuration, and not the containers. Have you setuped it like that?
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
Yes.. I know how it should work, or at least I think I know as I did that Wayfinder example..
The menu that I did works so that it expands the block that has that id="visible" on it. The wayfinder parentRowHereTpl and activeParentRowTpl chunks are configured to set that id. So, if you go in your example tree to the first visible container or any of it’s childs, that block will be set to open.
But, if you are not on any of the document’s that the menu lists, it doesn’t know which one to open.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
First of all I’d like to thank you for doing the example on the wiki - I was pulling my hair out trying to figure out how to use wayfinder. The long list of parameters is great, but didn’t really give me an idea how to implement the menu. Your example was perfect!
Ok, so onto my problem. I think I understand what you’re saying. Because I have the invisible container page it doesn’t know what page I’m on because it’s hidden. I assume I need to change the chunks to get round this. Is that right?
You should change the javascript that if that id="visible" is not found, it would open the first block anyways... or hide all. There is also some other variation of it
here.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
the accordion menu works fine so far but one thing disturbes:
after loading the page, the menu first opens completely (like a pure wayfinder menu), then collapses to the correct size and appearence.
what can be done so that the menu just appears in correct size from beginning?
It happens because the HTML gets loaded and rendered before the javascript runs (what then shows the menu in accordion style). This example used prototype and scriptaculous javascript libraries which are not very compact ones and takes some time to load.
Few things come to mind that you could try:
1. You could modify your CSS so that the menu is hidden by default and then make it visible in the javascript. That way your menu will be visible only after the javascript has been loaded. Eg. add visibility: hidden to the #accordion {} block in the CSS and then document.getElementById(’accordion’).style.visibility="visible" to the wfJs chunk afther the addEvent(window, "load", init); line.
2. Use MooTools instead of prototype / scriptaculous
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
thanx doze for friendly explanation
- 1. did not work for me
("no element" error in that line document.getElementById(’accordion’).style.visibility="visible" after the addEvent(window, "load", init); line
- 2. I thought about that several times for scriptaculous is heavy load for most cases. But I usually need Gallery, Ajax Search and some show/hide things ... and I don’t really have no idea what else depends on that scripts (Ditto, eForm ...?).
Newest MaxiGallery and Ajax Search versions use MooTools. Ditto and eForm doesn’t use scriptaculous/prototype by default I think.. But the first option should work too, I probably made some error in my example, you could try to debug it in firebug (firefox extension) and see what line throws that error.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."