Posted: June 11, 2013 at 7:21 pm
|
Hi, I am trying to get several different CSS Dropdown lists (from plugin custom files 3.1) on the same page showing events in different categories. Once I add more than 1 CSS Dropdown using the shortcode, only 1 of the dropdowns will open (the first one). I assume this is a Javascript problem and has to do with the DIV ID not changing. In the code, there is a ‘6’ next to the ids and classes, as well as in the OnClick events. I figure the best way to solve the problem is to dynamically call the event category to have this “6” changed to the categories id. Would this solve the problem? How would I get the event category id to ‘echo’ it onto the div ids? I have tried to call the category ids with no luck. Thank you in advance for help! |
Hi Cam, I checked into this and it looks to me that the CSS Dropdown was built to allow one dropdown per page. I think you’re on the right track with the idea of grabbing the category ID. I’m going to check in with the resident code Ninja to get his thoughts. |
|
|
Thanks Josh! The javascript does appear to be calling the “DIV ID” + ‘ID’ (ie. “lhsHeader” + ‘6″) to change the class and create the dropdown effect….So having the 6 dynamically changed to the category id should solve the problem. I just don’t know exactly how to call the event category id from the database or if it has a different call from standard WP. Below is the current SQL call setup: [code language=”php”]if ($type == ‘category’){ This may not be the right section of the SQL, but how can we add the call to the Event Category Id? Hopefully your code ninja will know… |
|
Oh yea, one other thing, which may or may not be of serious concern. Firebug in firefox is popping up this error associated with the main-javascript.js file every time the dropdown is clicked: rhsContent(page);
|
|
I got it working using this modification: https://gist.github.com/sidharrell/5769805 |
|
I found that I also had to modify line 130 of custom_functions.php to be: $registration_url = $externalURL != '' ? $externalURL : espresso_reg_url($event_id); to get the links in the dropdowns to work. |
|
Perfect! The code on github worked. I didn’t have to make the change to the custom_functions.php for the links to work. Have to say it was a great idea to just have a random number generated instead of trying to create a SQL call. Much simpler. Thanks Sidney… |
The support post ‘Multiple CSS Dropdown Lists on the Same Page’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.