how to link an element of a dynamic page to a dedicated page which is determined by the text value of the element on dynamic page?

Hello Wasim

you can do that by getting the text value of the element (and set it as the link format) then setting the link to it, after that you can redirect the user using wixLocation.to() method.

let link= $w('#text1').text
let pageLink ='http://'+link+'.com'  // "http://wix.com" 
wixLocation.to(pageLink)

Massa

Thank your suggestion Massa i appreciate. I will try this code on my website, i’ll inform you about the result.

Hey Massa, please tell me that i have to write these two line only or else will i have to add “import data from wix”. Please help because I’m from a non-technical background i have almost no experience in coding. I am trying to build a website for my start-up.

Hello Wasim

  • to use wixLocation.to() you have to import wixLocation:
import wixLocation from 'wix-location';

you can read more about wixLocation here: wix-location-frontend - Velo API Reference - Wix.com

  • you have to add those lines to the event that should link to that page (on page ready / on click / on mouse in / …)

Massa

Okay…thankx alot Massa

Very very great full to you.big time.

Hey Massa,
Your code worked. Thankyou so very much.

Hey Massa, how are you?
I need your help once again. I am attaching 3 photo in those photo u will see boxes with “x” and “✓” mark. I want to know how can hide those boxes with “x” when my respective drynamic page is visible. I have attached the picture of my database too. Please need i need your assistance. I have text you on Facebook messenger.

Hello Wasim

you can see this example of how to hide and show elements: https://www.wix.com/code/home/example/Hide-and-Show-Elements

if you have any questions you can post them on the forum for our wixCode team to help you.

Massa