# Nest not working

**URL:** <https://forum.finsweet.com/t/nest-not-working/2124>\
**Category:** Attributes\
**Created:** [November 1, 2023, 4:57pm UTC](https://forum.finsweet.com/t/nest-not-working/2124 "2023-11-01T16:57:18Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![PHD](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/phd/32/5822_2.png) [@PHD](https://forum.finsweet.com/u/PHD)\
**Post date:** [November 1, 2023, 4:57pm UTC](https://forum.finsweet.com/t/nest-not-working/2124/1 "2023-11-01T16:57:19Z")

</div>

Hi, I have everything set up correctly for CMS Nest, but it still isn’t working.

The Finsweet automated support says this, “The attribute fs-cmsnest-collection=“tags” is found, but the url link in the CMS Collection Item is not working. Check if the Link Block or Text Link have the correct link to the Item’s Template page.”

I have ensured the link is correct on all the CMS collections.

Read-only link:  
[https://preview.webflow.com/preview/healthiest-employers-2023?utm\_medium=preview\_link&utm\_source=designer&utm\_content=healthiest-employers-2023&preview=5c4cf80f3240f514fcdb59e5ef630e46&pageId=652da8f9bb88cbd08c396e9c&workflow=preview](https://preview.webflow.com/preview/healthiest-employers-2023?utm_medium=preview_link&utm_source=designer&utm_content=healthiest-employers-2023&preview=5c4cf80f3240f514fcdb59e5ef630e46&pageId=652da8f9bb88cbd08c396e9c&workflow=preview)

Any help is appreciated!

Thanks,  
Peter

---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [November 1, 2023, 5:24pm UTC](https://forum.finsweet.com/t/nest-not-working/2124/2 "2023-11-01T17:24:38Z")

</div>

Hey @PHD! This is a result of the template not being published, CMS Nest requires a functioning link to the template page of each to fetch the data to be nested. Can you test publishing the template page, please?

If you don’t want to publish these pages you can look into setup option #2 where no data is fetched from the template page.

 ![Screen Shot 2023-11-01 at 18.23.08](https://europe1.discourse-cdn.com/flex013/uploads/finsweet1/original/2X/9/9cf72348ace02d02e3c39b492ae05128c3c31cd4.png)

---

<div class="post-metadata">

**Author:** ![PHD](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/phd/32/5822_2.png) [@PHD](https://forum.finsweet.com/u/PHD)\
**Post date:** [November 1, 2023, 5:44pm UTC](https://forum.finsweet.com/t/nest-not-working/2124/3 "2023-11-01T17:44:34Z")

</div>

@Support-Luis Got it. Thanks! That’s good to know.

One last thing, I have a custom empty state for when there are no referenced CMS items. But that empty state isn’t showing. Is there a way to show the empty state?

---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [November 1, 2023, 5:58pm UTC](https://forum.finsweet.com/t/nest-not-working/2124/4 "2023-11-01T17:58:13Z")

</div>

I believe you can style the nested list’s empty state and this will show when the items are nested.

---

<div class="post-metadata">

**Author:** ![PHD](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/phd/32/5822_2.png) [@PHD](https://forum.finsweet.com/u/PHD)\
**Post date:** [November 1, 2023, 6:06pm UTC](https://forum.finsweet.com/t/nest-not-working/2124/5 "2023-11-01T18:06:51Z")

</div>

@Support-Luis Not showing on the site. Take a look.

It should show a faded “None” button when empty.  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/finsweet1/original/2X/8/8bce17d80ae37d22b9e33c51c9857c54e3137905.png)

> **[Honoring the Healthiest Workplaces Across the Nation](https://healthiest-employers-2023.webflow.io/nominations)**
>
> Here you'll find a list of our current regions with an active Healthiest Employers program. Are you a Healthiest Employer? Nominate your organization today.

---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [November 1, 2023, 6:33pm UTC](https://forum.finsweet.com/t/nest-not-working/2124/6 "2023-11-01T18:33:41Z")

</div>

I see, could you test this code on your page please?

```js
<script>
  window.fsAttributes = window.fsAttributes || [];
  window.fsAttributes.push([
    'cmsnest',
    (listInstances) => {
      console.log('cmsnest Successfully loaded!');

      //Replace this class with your actual empty button class
      let emptyElement = document.querySelector('.my_empty_element');

      let elements = document.querySelectorAll('[fs-cmsnest-collection="tags"]');

      elements.forEach(function (element) {
        if (element.innerHTML.trim() === '') {
          let clonedElement = emptyElement.cloneNode(true);
          element.appendChild(clonedElement);
        }
      });
    },
  ]);
</script>

```

---

<div class="post-metadata">

**Author:** ![PHD](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/phd/32/5822_2.png) [@PHD](https://forum.finsweet.com/u/PHD)\
**Post date:** [November 1, 2023, 6:59pm UTC](https://forum.finsweet.com/t/nest-not-working/2124/7 "2023-11-01T18:59:37Z")

</div>

@Support-Luis I added that to both the main page as well as the CMS template page. Nothing. I replaced “my\_empty\_element” with the “past-winners\_none” class which I used on the empty state element.

---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [November 2, 2023, 2:03pm UTC](https://forum.finsweet.com/t/nest-not-working/2124/8 "2023-11-02T14:03:15Z")

</div>

Hey @PHD! I see the empty button is now showing up correctly. How did you manage this?

---

<div class="post-metadata">

**Author:** ![PHD](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/phd/32/5822_2.png) [@PHD](https://forum.finsweet.com/u/PHD)\
**Post date:** [November 7, 2023, 8:28pm UTC](https://forum.finsweet.com/t/nest-not-working/2124/9 "2023-11-07T20:28:34Z")

</div>

@Support-Luis I just added the empty button element to the div with the [fs-cmsnest-element=“nest-target”] attribute. If there are CMS items to nest, then it replaces this element, and if not, then whatever is within the div remains.

---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [November 8, 2023, 11:22am UTC](https://forum.finsweet.com/t/nest-not-working/2124/10 "2023-11-08T11:22:48Z")

</div>

Awesome! Thanks for sharing!
