Link collection list to static pages

Hello there,

I am building a portfolio website and created my “home” with the help of the CMS collection list to show project previews (image, description, and CTA to project page). Now, I built each project page as a static page and I have trouble now linking the preview with the actual project page. Can you actually link them or does the project page need to be a collection page too?
Thanks a lot!

I use a similar system for my blog. I have a collection of posts, and most of the posts are CMS, but some of the posts are static pages.

So, in my collection, I added a Link Field named “static page link” for when the post is a static page.

In my collection lists, on each item, I have two button: one button has the CMS link “Current item” that redirects to the CMS item page, the other is a button link attached to the “static page link” field.

The button that link to the CMS page has a conditional visibility on “static link field IS NOT set”, and the button to static page has a conditional visibility on “static link IS set”. So only one button ever appear on each item, they look identical, and redirect either to the CMS post or the static post page.

6 Likes

This was a solution for me! thanks for making me aware of it!!!

1 Like

Hi-If your static page is one of your webflow pages, how do you get the url for that?

Never mind I figured it out but thanks, so glad I found this :slight_smile:

@vincent Thanks this is super helpful and it solved my problem.
BUT:
Is there a way to specify domain wildcard in the link address naming convention in webflow, when specifying the Static Page Link address - so that when I’m done building my site and ready to connect my own domain name to the project, i dont have to go back and manually change the static page link in every collection item used this way to point to a static page ?

ie, rather than:
http://my-webflow-username.webflow.io/static-page-slug … is there a something like:
*/static-page-slug

(where “*” will fill in “http://my-webflow-username.webflow.io” when I’m still publishing from Webflow’s url domain, but fill in “http://my-domain.com” once i connect my custom domain)

Thanks

You don’t need a wildcard, just put /static-page-slug as the address… I mean depending on where you place the link. Could be …/static-page-slug if your page was already in a subfolder.

@vincent That was the first thing I tried, but Webflow blocks/disallows that at the CMS field! See screenshot attached. Error: "Should be a valid url like “http://webflow.com.”

CleanShot 2021-09-06 at 17.26.32|671x119

Hmm maybe if I make this a text field (not a Link Field) is it possible to bind it that way? I don’t think that will surface it in collection list as an option, right? How did you resolve this?

thanks

I don’t know what you are talking about here. Webflow won’t allow links in collections that are just “slugs”, must be a full url. The only way I found is by hacking an embedded anchor. No matter what I try, there is no chance I can link to a static page natively from collections.

Screenshot 2023-10-17 at 14.05.56

Is also frustrating that @callmevlad said that mixing static content in collection pages won’t be happening anytime soon.

I don’t think I’m asking for anything special - all I want is to build custom pages (static is OK) and want to be able to list them with a collection because manually would be painful.

Webflow only accept full links in links fields. But a link field is a text field with limitations. Use a text field for your ../target links and compose them back using custom code.

Yes. I know, that’s what I meant.

Yes. That’s what I’m doing. It is exactly what I shared above.

But I mentioned before that this feels like a hack, we should have a way to do this natively.

Don’t you think?

Hello, Thank you for providing such a great solution,
I have question about how to link button with “static page link” field.
Could you provide any screen shots for the process? :smiley:

Hi Hongxuan,

Webflow seems to have made a change recently which allows you to store relative paths in a CMS link field, e.g. /about

Webflow renders this just fine, but…

  • There is no checking, the URL might not exist, so check your work
  • Localization does not [yet?] auto-convert that to the locale you’re viewing, you’ll just get the page version you’ve requested