Ok, i think now i understand your problem.
- Create a new FIELD inside your DATABASE and set it as TYPE → URL
- You have a dynamic setup, that means every of your pages is a value inside your DATABASE. And also for every of your values a dynamic - LINK will be created automaticaly.
But to generate the right LINK-FORMAT, i think you will need the FULL-LINK, which you than copy to the new generated URL-FIELD ( your idea could work )!
Open one of your dynamic pages…and you will get something like…
https://joshwelchwebsites.wixsite.com/my-site-3/hikes/arthurs-seat-eagle-summit-walk
This link concists of 3-parts:
- https://joshwelchwebsites.wixsite.com/my-site-3
- /hikes/
- arthurs-seat-eagle-summit-walk
So your idea is good and all you have to do is to generate a normal LINK-URL out of your dynamic setup.
The following one is - - > STATIC - - > It will be the BASE-URL…
let baseURL = "https://joshwelchwebsites.wixsite.com/my-site-3"; console.log(baseURL);
Then you have a field called → Recipes(All), there you can get the middle-part…
let let us call it - → PREFIX…
let prefix = getCurrentItem()["ID_OF_RECIPES_ALL_FIELD_HERE"]; console.log(prefix);
And the last part you can get from —> Recipes(Name)
let itemURL = getCurrentItem()["ID_OF_RECIPES_NAME_FIELD_HERE"]; console.log(itemURL);
Put everything together and make it work…
$w.onReady(()=>{
$w('#myDataset').onReady(()=>{
let currentItem = $w('#myDataset').getCurrentItem(); console.log(currentItem);
// and so on ......
// add the given code above here & put everything together....
});
});
Good luck!