-
Notifications
You must be signed in to change notification settings - Fork 712
Fix filter buttons when reusing projects template for multiple sections #1098
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
Conversation
✅ Deploy Preview for toha-ci ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-authored-by: hossainemruz <12577390+hossainemruz@users.noreply.github.com>
Co-authored-by: hossainemruz <12577390+hossainemruz@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Device | URL |
|---|---|
| desktop | https://6913d9b256572c000859844d--toha-ci.netlify.app |
| Device | URL |
|---|---|
| mobile | https://6913d9b256572c000859844d--toha-ci.netlify.app |
| Device | URL |
|---|---|
| desktop | https://6913d9b256572c000859844d--toha-ci.netlify.app/posts/ |
| Device | URL |
|---|---|
| mobile | https://6913d9b256572c000859844d--toha-ci.netlify.app/posts/ |
| Device | URL |
|---|---|
| desktop | https://6913d9b256572c000859844d--toha-ci.netlify.app/posts/markdown-sample/ |
| Device | URL |
|---|---|
| mobile | https://6913d9b256572c000859844d--toha-ci.netlify.app/posts/markdown-sample/ |
| Device | URL |
|---|---|
| desktop | https://6913d9b256572c000859844d--toha-ci.netlify.app/posts/shortcodes/ |
| Device | URL |
|---|---|
| mobile | https://6913d9b256572c000859844d--toha-ci.netlify.app/posts/shortcodes/ |
Not what you expected? Are your scores flaky? GitHub runners could be the cause.
Try running on Foo instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Device | URL |
|---|---|
| desktop | https://6913da747231cf00080c7e27--toha-ci.netlify.app |
| Device | URL |
|---|---|
| mobile | https://6913da747231cf00080c7e27--toha-ci.netlify.app |
| Device | URL |
|---|---|
| desktop | https://6913da747231cf00080c7e27--toha-ci.netlify.app/posts/ |
| Device | URL |
|---|---|
| mobile | https://6913da747231cf00080c7e27--toha-ci.netlify.app/posts/ |
| Device | URL |
|---|---|
| desktop | https://6913da747231cf00080c7e27--toha-ci.netlify.app/posts/markdown-sample/ |
| Device | URL |
|---|---|
| mobile | https://6913da747231cf00080c7e27--toha-ci.netlify.app/posts/markdown-sample/ |
| Device | URL |
|---|---|
| desktop | https://6913da747231cf00080c7e27--toha-ci.netlify.app/posts/shortcodes/ |
| Device | URL |
|---|---|
| mobile | https://6913da747231cf00080c7e27--toha-ci.netlify.app/posts/shortcodes/ |
Not what you expected? Are your scores flaky? GitHub runners could be the cause.
Try running on Foo instead
Issue
Fixes issue where filter buttons scroll the page instead of filtering items when the projects template is reused for custom sections (e.g., "Talks, Posters & Conferences").
Description
Root cause: Template generated hardcoded IDs. When reused,
getElementById()only found the first section, leaving others uninitialized.Template (
layouts/partials/sections/projects.html):project-card-holder-{{ $sectionID }},project-filter-buttons-{{ $sectionID }}data-section="{{ $sectionID }}"to containers and buttonsJavaScript (
assets/scripts/sections/projects.js):getElementById()toquerySelectorAll('.filtr-projects')Each section now filters independently.
Test Evidence
Setup: Create a custom section reusing the projects template:
Verify:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.