Loading...
 
Skip to main content

Features / Usability


Dynamic collapsed menu... isn't collapsed by default.

We're trying to use the dynamic collapsed menu how it is expanded by default. We have a large number of items on your menu and it is inconvenient for visitors to have it completely expanded. Is there anything obvious I'm missing or that I should check?

> We're trying to use the dynamic collapsed menu how it is expanded
> by default. We have a large number of items on your menu and it
> is inconvenient for visitors to have it completely expanded. Is
> there anything obvious I'm missing or that I should check?

I've noticed another thing. I first load the page everything is expanded. I than click on one of the folders to close that folder but it doesn't just close the one folder. It closes *all* of the folders. It is almost as if something isn't get triggered properly initially.

> > We're trying to use the dynamic collapsed menu how it is expanded
> > by default. We have a large number of items on your menu and it
> > is inconvenient for visitors to have it completely expanded. Is
> > there anything obvious I'm missing or that I should check?
>
> I've noticed another thing. I first load the page everything is expanded.
> I than click on one of the folders to close that folder but it doesn't just
> close the one folder. It closes *all* of the folders. It is almost as if
> something isn't get triggered properly initially.

It looks like if there is no menu cookie than it defaults the menu to being completely expanded regardless of the type of menu. I may be reading that wrong but if I'm understanding things right it sure looks like a bug. Can somebody confirm/deny?

> > > We're trying to use the dynamic collapsed menu how it is expanded
> > > by default. We have a large number of items on your menu and it
> > > is inconvenient for visitors to have it completely expanded. Is
> > > there anything obvious I'm missing or that I should check?
> >
> > I've noticed another thing. I first load the page everything is expanded.
> > I than click on one of the folders to close that folder but it doesn't just
> > close the one folder. It closes *all* of the folders. It is almost as if
> > something isn't get triggered properly initially.
>
> It looks like if there is no menu cookie than it defaults the menu to being completely expanded regardless of the type of menu. I may be reading that wrong but if I'm understanding things right it sure looks like a bug. Can somebody confirm/deny?

I deleted menu-related cookies for themes.tikiwiki.org in my browser and, when reloaded, the menu was collapsed (mostly; the admin folder was still open. I'm not sure of the reason for that). Similarly, when I come to a Tiki site for the first time, the main menu (which is generally collapsed by default) is in fact collapsed, and this is the pre-cookie state as its my browser's first visit to the site.

I guess if the problem at your site is a bug, it must stem from some circumstances that don't normally occur. We can see this by the fact that the usual case at Tiki sites is for the menus to be collapsed by default. I mean the behavior is as expected. Is your site public, so I or others can check their experience with the menus/cookies?

Any other cookie-related weirdness? For example, if you have module expanded/collapsed turned on, each module should stay as last set by the user, just as the menus should.

About the other thing you noticed — clicking one folder icon closed closes all the folders — I've noticed this too, especially in Firefox, in menus that otherwise functioned normally. It may not necessarily be related to the other problem; maybe it's a quirk in the javascript.

-- Gary

> > > > We're trying to use the dynamic collapsed menu how it is expanded
> > > > by default. We have a large number of items on your menu and it
> > > > is inconvenient for visitors to have it completely expanded. Is
> > > > there anything obvious I'm missing or that I should check?
> > >
> > > I've noticed another thing. I first load the page everything is expanded.
> > > I than click on one of the folders to close that folder but it doesn't just
> > > close the one folder. It closes *all* of the folders. It is almost as if
> > > something isn't get triggered properly initially.
> >
> > It looks like if there is no menu cookie than it defaults the menu to being completely expanded regardless of the type of menu. I may be reading that wrong but if I'm understanding things right it sure looks like a bug. Can somebody confirm/deny?
>
> I deleted menu-related cookies for themes.tikiwiki.org in my browser and, when reloaded, the menu was collapsed (mostly; the admin folder was still open. I'm not sure of the reason for that). Similarly, when I come to a Tiki site for the first time, the main menu (which is generally collapsed by default) is in fact collapsed, and this is the pre-cookie state as its my browser's first visit to the site.
>
> I guess if the problem at your site is a bug, it must stem from some circumstances that don't normally occur. We can see this by the fact that the usual case at Tiki sites is for the menus to be collapsed by default. I mean the behavior is as expected. Is your site public, so I or others can check their experience with the menus/cookies?
>
> Any other cookie-related weirdness? For example, if you have module expanded/collapsed turned on, each module should stay as last set by the user, just as the menus should.
>
> About the other thing you noticed — clicking one folder icon closed closes all the folders — I've noticed this too, especially in Firefox, in menus that otherwise functioned normally. It may not necessarily be related to the other problem; maybe it's a quirk in the javascript.
>
> — Gary

Well, what I had to do to make it work on our site was to change the following code in tiki-js.js. It originally appears:

function setfolderstate(foo, def) {
var status = getCookie(foo, "menu", "o");
var img = "fo.gif";
var src = img; // default
if (status == "o") {
show(foo);
src = "o" + img;
} else if (status != "c" && def != 'd') {
show(foo);
src = "o" + img;
}
else {
hide(foo);
}
document.getElementsByName(foo + 'icn')0.src = document.getElementsByName(foo + 'icn')0.src.replace(/^\\/*$/, src);
}

I had to change the getCookie line to:

var status = getCookie(foo, "menu", "c");

We've found that when there is no menu cookie the menu defaults to open if there's a 'o'. Changing it to 'c' fixed it for us. I'm not sure what that argument is actually supposed to do but it seems to specify the default state of the menus. o for open c for closed. Do you know if there's anything else that would affect this? Do templates or .css files affect it? Once the cookie is set it works fine regardless of what that line has for a third argument.

The only other cookie related weirdness we've found is that if there is no tz_offset cookie set than the page will display articles in UTC. This is less of an issue because the tz_offset is set automatically and the next page view or refresh will display correctly. It's still weird that the page seems to be able to set the cookie or read it but not both.


> We're trying to use the dynamic collapsed menu how it is expanded by default. We have a large number of items on your menu and it is inconvenient for visitors to have it completely expanded. Is there anything obvious I'm missing or that I should check?

I changed the "o" to "c" in the tiki-js.js statement as suggested in the last post & the all the menus still default to open & re-open after manually being closed with each screen refresh. Any other ideas?