-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple polls on the same page #35
Comments
@lesterchan Any idea from the top of the head what changes would be needed, in case someone wishes to send a pull request? |
@espellcaste lots of changing. First you need to modify the template to ensure that id="polls-{id}" is no longer being used, instead it should be class="polls-{id}" after that you need to modify the JS file to find the .polls-{id} being rated |
would love to see this, for years (I mean literally, been using this since 2006) i couldn't figure out a proper way to do this. would it be easier to have a logic that hides the sidebar poll, when i manually added it to main content? |
Got it @lesterchan! It seems not that complicated... I'm gonna try to suggest something in the future. =) |
I would suggest |
Any advantages in this approach @bitinn? |
@espellcaste generally speaking, separating class name from javascript is a good idea, both for separation of concerns and ease of maintenance. In our case the poll id serve no actual styling purpose, but is used as selector in jquery, since repeat with |
I agree. I would go with data-poll_id= and .poll-. Some people want specified style for a poll, so i think have a specific class is good as well. |
Good point @bitinn. I agree @lesterchan. |
@lesterchan Any updates on this after 4 years? :P |
Changes has to be made to not use id but class like .poll-1 and not #poll-id alongside with javascript changes that find the context of the poll button being clicked.
https://wordpress.org/support/topic/weird-things-happen-when-the-same-poll-is-showing-in-content-and-sidebar?replies=3#post-6512375
The text was updated successfully, but these errors were encountered: