I’ve created a gallery navigation bar of sorts that lists all gallery categories with subcategories ‘nested’ beneath them. What I want to do is be able to expand/collapse the list of subcategories by clicking on an icon or the category lable. I’m using some {if/else if} statements to create linked vs. grayed out sub-category names, but otherwise, I think the code is pretty standard.
The gallery page for my site can be seen here: www.canted.com/index.php/tca/tca_idxpg/
The code I use is this:
At the top of the page I put these (I use the same code on more than one site) {assign_variable:blog_name="tca"} {assign_variable:gallery_name="tcag"}
I suspect that’s a brute force approach, but it gets me what I want—if I can find a way to collapse the list.
I’ve spent the day playing with ddanimated div, toggle menu, and other jquery items, but I’m just not sure where to insert the added code, and I’ve worked myself in circles, so any advice, guidance, or examples would be most welcome.
I’d suggest simplifying the markup to a a nested list (which is what it is after all) and have a look at the Jquery UI Accordion plugin.
That page has several examples where you can check both the markup used and the script code. Good luck
I considered that and I looked at the jquery accordion code, but I was under the impression (and am still, after rereading the EE Gallery user docs) that I have to use the ExpEng markup for gallery categories, which does not seem to have a nested option (i.e., style=“nested”).
Are you saying that I need not use the table/row code for gallery categories; that I can code gallery categories the way I would weblog categories? That sure would be a lot easier and cleaner!
Either way, I would be most grateful for a code-pointer (which tags to use, if not the actual markup).
My bad, I didn’t notice that it was the gallery categories code, not the standard ones.
Seems odd that there is a category list tag but that that only shows the main categories, not the subcategories.
To be honest, I’ve never used the gallery so I’m not much help there I’m afraid.
I hadn’t tried the category list code. I was focused on having the subcategories display in a different font size, etc., than on nesting, and so I went with the table/row code. I think I’ll try the category list tag and see what it gets me.
As for what’s there, I did try using the ddaccordion which lets you put the expand/collapse code separate from the list, but it requires each category to have a unique name, which has to be coded in advance of the list generation. In other words, there does not seem to be a way to make it dynamic, based on the categories that exist at the time.
Anyway, thanks again.
/npl
BTW, I looked at your site and recent work examples. Very nice and very neat. The Antipodean Dance text on the main screen fades a little too fast for me to read, but I’m an old guy, so I’m used to that… Otherwise, it’s very appealing stuff.
BTW, I looked at your site and recent work examples. Very nice and very neat. The Antipodean Dance text on the main screen fades a little too fast for me to read, but I’m an old guy, so I’m used to that… Otherwise, it’s very appealing stuff.
Thanks for the compliment, it took me a few seconds to get the antipodean dance reference though (I’ll set the timeout a little slower, you may be right about the speed!)
You can ignore the fact that the default categories code includes all that table stuff. Here’s some code I’ve used before that uses just a simple unordered list:
Thank you both. I tried out both of your suggestions and variations and combinations of both, including a switch to the category_list tag, but none of them does exactly what I want. I even tried using just the <li> tag without the <ul> or <ol> tags, and that actually worked, except for the bullet/indent, so I tried doing something with the subcat_marker, but in the end I just couldn’t think my way through this. Basically, I want to show empty categories grayed out, I want the subcat links to be a smaller font and to have a marker of some kind, and I want to be able to collapse the whole so that the visitor doesn’t have to scroll around so much. I know I’ll need to compromise—maybe even do a completely different layout (ugh)—I’m just not sure how to get there from here.
One thing that would help immensely is if I could use a conditional to test for a subcategory, e.g., {if subcategory=“true”}. Any ideas on this one? If I could do that, I could use just one line of code like Tyssen’s, add the subcat marker code, _AND_ apply the ‘link’ formatting. And that would get me where I need to be to use the jquery accordion code, I think.
Anyway, both of your suggestions gave me some very good ideas and I’ve learned a lot just fiddlin’ with it, and, if nothing else, you’ve showed me how to clean up the code so that I’ve reduced it to this:
I am getting closer, I think. I’ve managed to work some CSS and some ExpEng code together to get it looking almost the way I want using an <li> tag and just the category row. I’m not sure yet, but I think, I can make this work with the accordion code if it lets me style the category and the subcategory (stuff inside the collapsible part) differently.
The test-code there now (a kludge, which I will clean up when I get it working) is this:
It’s hard to say without seeing the actual markup this produces, but it shouldn’t be that hard with the proper css/html.
jQuery has some very powerful selectors, as soon as you have a “hook” (a claas or id usually) you can get to pretty much any element in the dom.
e-man, thanks, but I’ve pretty much given up on that for now. Nothing I do works, and there is just no way to make the gallery do everything I want it to anyway, so I’m looking at maybe moving everything out of EE to some other gallery/phot manager, and just linking to it somehow.
I’ve posted a request for help to the “how do I do this” forum, but so far, no answers, so I am assuming it either can’t be done or that I need to learn a lot more about scripting and so on…
Anyway, thanks again for your interest.
BTW, the simple solutions would have been as you pointed out a style=nested for gallery categories, or an ability to test for subcategories w/ a conditional.
Well, I’ve got several thousand images that will ultimately be on-line, and I like being able to upload just one size and have the thumbnail and a watermark automatically applied, and have the images categorized (and be easily recategorized), etc. Basically, I was looking for something that would make it easier than what I was doing before (all manual), and so far that’s been pretty much the case, but the batch loading and naming has proven to be a bit klunky too, so I was already leaning toward seeking another solution.
Anyway, thanks again for your time. If I find a way to do what I want, I’ll post back here…