Page as a data field

Hey folks. Does anybody know if it’s possible to have a site page as a database field? The reason I’m asking:
I’ve got a repeating group with “resources”. Each resource is a record in a “resources” data type, and has a landing page on the site. I want people to be able to click a link in each item in the RG and be taken to that page. Right now, I’ve got a field in the data table called “URL”, but I have to hard code the URL into that field. It makes working across environments (dev, production) difficult…

Anybody?

I’m not sure what you mean by have a page as a data type field…

But if I understand your question correctly, you’re just asking how to go to a page for a particular database thing?

Assuming you want to use a ‘link’ element (as opposed to running a go to page workflow), the simplest way is to set the link destination to the current cell’s thing’s link (then select the relevant page to link to).

Alternatively you can use Website Home URL followed by the page path, then the thing’s slug.

If your using a workflow action rather than a link then you can just go to the page and send the current cell’s thing.

1 Like

Hi Adam. Thanks for replying. Here’s what I have:
Nova Blue Technologies (bubbleapps.io)

…you can see that the resource cards each have a CTA such as “watch the video here >”. The database has a CTA field (used to populate the text) and a “link” field (that I use to link to a page).

I’ve then built a workflow that when clicked goes to that URL. The problem is that I’ve had to hard-code the URL, and when I deploy to prod, the links won’t work any more…

Any ideas?

I’ve then built a workflow that when clicked goes to that URL. The problem is that I’ve had to hard-code the URL, and when I deploy to prod, the links won’t work any more…

Do you mean you’re trying to link to things from your ‘dev database’ in your ‘live app’?

1 Like

I appreciate your help pal.

Not quite. Check out the data table:

The “URL” field is currently pointing to the “test” environment. When I deploy to live, this URL will still…oh wait…

NEVER MIND! I’ll have to re-upload all the data anyways.
These aren’t the droids you’re looking for… (bubbleapps.io)

Thanks!!

Right, I understand now…

So from the screenshot it’s clear your ‘link’ fields are not linking to dynamic pages (as I assumed they were)…

So the solution is simple…

As I said in my first reply, if you use WebsiteHomeURL/Page-name it will automatically refer to whichever version of your app you’re in - so instead of saving the entire URL in your URL field, just store the page name as a text (i.e. “landing_leaderguide”).

Then just use Website Home URL: current cell's URL as the destination URL in your workflow (note: the ‘Website Home URL’ includes a trailing slash, so don’t include another one).

1 Like

You, sir, are a legend :smiley:

1 Like