Link to page in formula

Hi,

I am generating a list of links from a collection in repeating divs.
example: Topic1, Topic2, etc

I would link to add a link to the div that goes to that specific page, but when I add, for example, “Topic1” in the formula it does not navigate. It opens a new tab and defaults to home page.

I’m in preview mode.

Am I missing something obvious?

Any help appreciated.

Thanks
Cas

2 Likes

Hi @Casanuda :wave:

I think this video on how to create dynamic collection pages in WeWeb might help.

Let me know if not!

Hi Joyce,

Thanks for the reply. Thant’s not quite what I’m looking form.

Maybe to elaborate:
I am storing a list of pages on Airtable and then in weweb drawing a navigation from that list.
eg. Topic1, Topic2, etc

Each topic has a unique design so I am creating a unique page for each topic.

On click of the navigation I was trying to substitute the page with a forumula which is the text of the clicked button.

So If I click Topic1 the page formula is “Topic1”.

Problem is it does not work.

I tried all sorts of combinations “/”+Topic1, “Topic1”, etc

Just unsure if you can substitite the page name with a formula containing a string of the desired page.

Thanks
Cas

1 Like

Hey Casanuda,

Were you able to sort this out?
I have the same issue!

Thanks!

If you want to use a generated path you can use the new path mode on the change page action.
Toggle the path mode and bind the path you want to navigate. If the path match one of your configured page it will successfully navigate :slight_smile:

Thanks Alexis.

A few questions though:

  • Is the expected path absolute or relative?
  • Do you know if the path should include the language? (like /fr/pagename)

I finally found that the expected result of the formula should be a page id (not a name).

Page id if you dont use the path mode yes! Some people need to use a path it’s why we added the option. But if you know the id of the page you want to redirect its better to use them. You can bind it from the explorer, we expose every page with their ID

For the path mode, it must be the absolute path, and yes you should include the lang if you want to redirect to a given lang. You can bind the current lang so your user remain on the same lang as the page he is redirected from :slight_smile:

1 Like

Thank you very much, Alexis.
I used the path option, which works fine.

I noticed that it worked the same way in the direct “link to URL” alternative (instead of the “change page to path” workflow). If you confirm this, using the same term (aka Path) everywhere would be more consistent imho.

Its not really the same. I think link to URL can be used for external link. And for internal links. it will not handle as many case as change page. Some will not work in the editor (for example linking to a page with a dynamic path)

But yeah we have probably something to do with the lack of consistency between both way to navigate, thanks for your feedback