Streaming live at 10am (PST)

Dynamic list on an individual collection page


#1

Hoping I can explain this correctly. Under "Services" on my site there is a page called "Biologic Dentistry". On this "Biologic Dentistry" page, I'd like to have links to different types of Biologic Dentistry that are set up in a different collection. Is there a way to add that to the Services template? Currently every time I add a dynamic list to the Service template page it adds it to every service page.

I've found I could go in and add link fields to the Services page that I could populate with the different biologic dentistry pages, but that doesn't feel like the best or easiest way to update in the future. Thanks!


Here is my public share link: https://preview.webflow.com/preview/van-hala-dental?preview=65ba45915414d956380013c3eed2a2af
(how to access public share link)


#2

Add the dynamic list to the page as intended then publish and share the live URL...


#3

You'll notice that at the bottom of every service page there is a placeholder icon with a read more link from a dynamic list I've placed on the Dental Services template. I'd only like that dynamic list to appear on the Biologic Dentistry page under Services though.

Also included on the Biologic Dentistry page is my manual input of fields in the Dental Services template to possibly get around the issue if needed.


#4

Paste this in Dental Services Page Settings > Custom Code > Footer Code, to hide it if it's not biologic-dentistry page:

<script>
if(location.href.indexOf('biologic-dentistry') === -1) { $('.w-dyn-list').remove(); }
</script>

#5

That seems to have worked but I don't see where to place in the footer code and placed it in the "Before body tag"

That made it work but then the dropdowns were buggy on the pubished site. Where do I find the footer custom code area for that page?

Thanks!


#6

Hi Sam, any tips on solving this?


#7

#8

Sam, I see I can put it in the project settings footer code area or the body of the Dental Service page setting body content area. If I put it in either of those places though, my dropdowns stop working?


#9

Oh right, the script is removing all dynamic lists on your page.

To remove one only, you have to give your dynamic list (the one we are removing) a class name like
my-dynamic-list

Then, you need to change the jQuery selector to the published class name:

$('.w-dyn-list').remove();

to

$('.my-dynamic-list').remove();

#10

Worked perfect. Thank you!!!!!