Drop-down list in ajax mode
-
Hi,
Categories drop-down list is not working when using it in ajax-mode. The drop-down displays just fine, but selecting an item and pressing the button doesn’t do anythng.
-
Do you have both the [link-library-cats] and [link-library] shortcodes on your page?
If you switch back to a list or table view for the categories, is the ajax update working correctly?
Can you give me a link to your site where I can see this problematic behaviour?
I have done tests with the drop-down list on my development site and it is working correctly.
Did some testing on my local install and live site.
On local install I’m using latest version with this shortcode:
[link-library-cats settings=2 categorylistoverride="10,11,12,13"] [link-library settings=1]
where library 1 is set to display a single category that I’m using as a search filter.
Also, I set it to display 1 category at a time.Library 2 is for displaying the drop-down (with cats specified in the override) and it’s also set to display 1 category at a time, otherwise clicking a link will produce linkresultpage and anchor link. Either way it’s not working.
I also tried adding the drop-down cats to categories to be displayed in settings set2 but that doesn’t work either.
Limiting categories to be displayed in set1 so far never prevented link results when clicking on a category link (hence using categorylistoverride to display the categories).
Thinking that it just doesn’t work when combining 2 sets I tried it on my live site (see tab “bestemmingen” and I got it working. So it’s some misconfiguration or a plugin conflict on my local install.
I also found that the drop-down outputs link elements as defined in set2, whereas I was expecting it to get those via the link-library shortcode (set1).
Anyways, thanks for your support.
You are going to need this for it to work:
[link-library-cats settings=2 categorylistoverride="10,11,12,13"] [link-library settings=2 categorylistoverride="10,11,12,13"] [link-library settings=1]
The first shortcode will display the drop-down containing categories 10,11, 12 and 13, the second one will display the links for one of these 4 categories, and the third shortcode will display whatever it’s configured to display.
Wow, thanks that was a blazingly fast reply.
On https://reisfavoriet.nl/aanbieders I’m actually using
[link-library-cats categorylistoverride="1,2,3"] [link-library-cats categorylistoverride="1,2,3"] [link-library-cats categorylistoverride="1,2,3"] [link-library-cats categorylistoverride="1,2,3"] [link-library-cats categorylistoverride="1,2,3"] [link-library-cats categorylistoverride="1,2,3"] [link-library-cats categorylistoverride="1,2,3"] [link-library-cats settings=2 categorylistoverride="1,2,3"] [link-library-cats categorylistoverride="1,2,3"] [link-library-cats categorylistoverride="1,2,3"] [link-library settings=1]
with different id’s of course. And it’s working. I’ll try your code on my local install.
Thanks for your support.
Right. In that example that you just mentioned, all of the link-library-cats entries are default to settings=1, and then you have an instance of link-library with settings=1 at the bottom. This is why this works. In the other two-line example you had above, you only displayed cats with one settings id and the library with another id, so that is why they did not connect.
Whatever I try I can’t get it to work on my local install. Had a look with firebug and in the console I see admin-ajax.php with 200 OK .,..s. In the reply I see output content that matches the category I clicked, but it doesn’t get rendered to the screen for whatever reason.
Only when I change one of the sets to html, the ajax set will work.
On another note, drop-down without the go button could be useful. Mobile browsers tend to show a custom screen for drop-downs and having to press the button after that can easily be missed.
Could you send me the HTML output for your page when it’s not working so I can try to understand what is happening?
I’m currently traveling and have a bad connection, but will attend to it when I get home.
Back home and did some more testing. On my live site I noticed that clicking a link creates a child div #linklist* with the content inside the parent #linklist* div (where * matches the set number). This wasn’t happening on my local install.
My site is running on the gantry framework which has lots of options, and allows to create overrides with it’s own settings and widgets, which can be assigned to one or more pages, posts, content types etc. Powerful stuff, but it can become complex and hard to find problems.
At first I thought it was related to wordpress auto paragraphs, but further digging I found that merely having [link-library-cats] in a textwidget on the sidebar or any other widget position is what makes it work with 2 setting sets.
I have also seen with this framework that some plugins’ scripts are not added to the head. With the addthis plugin it’s content is not output to the main content area, but it’s widget does work. So for now I’m assuming it’s a bug in the framework causing this.
If you’d still like to have a look let me know and I’ll send you working and non-working html output.
Sorry for the lack of reply. I wanted to check if you were still using Link Library and still had issues with the AJAX drop-down update before I got back to investigating the issue further.
It does seem like you marked the issue as resolved but I wanted to be sure.
I still have the issue on my local install only, for whatever reason. I stopped investigating and haven’t updated the plugin (the install is a mess anyway).
Funny detail is that it works if I first output library 2 then library 1. Swap them, then it stops working.
I have not found a way to reproduce this, so I will stop investigating for now. Let me know if it ever comes back up again.
- The topic ‘Drop-down list in ajax mode’ is closed to new replies.