Streaming live at 10am (PST)

Relative path in collection, link field


#1

I need to have a link field in a collection accept a relative path. I am passing variables to the target page. /sign-up?plan=Basic&price=50&planID=1
I need to do this in order to maintain continuity between a dev/staging and the production site's.
I get an error when entering a relative path in a collection item.


#2

I'm gonna bump this, because using relative links makes everything easier ...which is surely what the CMS is designed for!


#4

Hey Sam,

This is the error message you get when entering any relative link:

This is problematic when building in the Webflow staging environment, as these absolute links will need to be changed after going live — example.webflow.io to example.com

Is there any other way to reference static pages within the CMS?

Thanks in advance!


#5

A workaround is use a normal text field with the link in custom code.


#6

Thanks Sam, what might this custom code look like exactly? I'm unable to work out how to connect a link block to anything other than a CMS link field.

I'm trying to set page links to individual static pages, example below:


#7

Here are some link examples:


#8

Just a thought, if you have the room in your collection, put in two link fields, "Staging Link" and "Live Link", then changing over just before going live is a matter of changing just one "Get URL from..." selection on a page. Found it easy to implement, just a bit more work to enter two versions of the link.

Hope this helps.