That should work. What happens when you put that in a post?
when i do that neither of the lists show?
If I test each one they all appear independently.
The forms are similar and use the same fields names for search purposes.
Would that make a difference?
That is strange. Can you please try and turn on WP_DEBUG and post the output (if any) here.
I turned on Debug and got this on the screen when trying to load the page with 2 lists on.
Fatal error: Cannot redeclare get_sticky_setting() (previously declared in /home/sites/awlinspection.net/public_html/wp-content/plugins/gravity-forms-sticky-list/class-sticky-list.php:217) in /home/sites/awlinspection.net/public_html/wp-content/plugins/gravity-forms-sticky-list/class-sticky-list.php on line 217
Any ideas?
Ok, it seems that you are using an older version of Sticky List. This issue was fixed in 1.2.10 (latest version is 1.2.12). Updating Sticky List should solve this issue. You can see the changelog here.
That’s done the trick.
thanks very much for your help.
No probelm. If you like the plugin after having used it for a while, please consider writing a short review. Thanks!
Hi – I have a related issue.
I can include multiple [stickylist] shortcodes on the same page, but because the delete <script> block is included for EACH sticky, it means the window.listUpdated() function gets subsequently overwritten, and so uses the wrong form ID in the ajax call. (The form_id is hardcoded into each script block)
Would it be possible to scope the .click() function in each script block? Something like
$(‘#stick-list-wrapper_X .sticky-list-delete’).click(…
Where X is the form ID being hardcoded into the script block? That way, each <script> block would only target the delete button in its shortcode output.
Even better – perhaps either make the onload function anonymous (or at least unique, by including the form ID) so that it doesn’t get overwritten at all? Looking at a test I did, it seems the first [sticklist] will set the function, and subsequent shortcode functions get ignored.
Is this doable?
Thanks!
Thanks for the detailed bug report. It’s absolutely doable and I’ll fix this in the next release. I’m on a work trip atm but I’ll try to get this updated within a couple of days.
Also, if you like, you can submit a pull request on the Github page. See link in description.
Sweet! Not done much collab with Git before but if I get a sec, I’ll try a pull request.
Either way, I sent you few bucks to say thanks for the quick reply! Your plugin is a small part of a client project I’m making, and I’m trying to avoid having to use the more complex (but awesome) GravityView plugin.
I have fixed this. I added scope to the delete function as you suggested. I will release an update later today. Let me know if it works for you.
…and thanks for the donation!