Redirect a Page to dynamic link from Webflow CMS

Hi there,

Can someone tell me how you would redirect a page to an element being stored in a webflow CMS:

I have a snippet of code here:

Then I want the “www.website.com” to pull in a URL from my collection site dynamically.

This is the URL and collection page I want to pull from:

Is this possible?


Here is my site Read-Only: (Webflow - Scraps Recipe Website)
(how to share your site Read-Only link)

Hey Nicholas;

I can’t see the snippet, you need to wrap it in 3 backticks ( ``` ) above and below for the forum software to display the code.

Redirecting to a webflow collection page is easy, as long as you know the collection slug and item slug.

const memberCode = "mem_2jhjk2h5kj32j3h4k2j";
window.location.href = `/members/${memberCode}`;

A few important things though about your Memberships collection and storing users there.

  • The CMS plan allows 2,000 total CMS items max, and 10,000 members. If you try to create a CMS item for each member, make sure to keep your member count low.
  • There is no way to turn off CMS pages in the auto-generated sitemap.xml, so if that ever becomes an issue, you might need to manually generate your sitemap.xml.
  • Don’t store any secure info on those CMS pages. Memberships allows you to gate the entire CMS page from the public ( non-logged-in ) users, but not between the members themselves. If Bob has an account and he is determined, he can access everyone else’s member Collection page too. This goes back to the sitemap.xml security risk above, if you’re trying to do this.