How to use metaobjects in links

LCParis
Visitor
1 0 0

Hello,

 

I created a metaobject called Creators, which has a name and a description, the webpage is actived.

 

The link is pages/creators/name_of_creator

 

I linked each product to as creator.

 

Now on the product card I managed to show the name of the creator

Capture d’écran 2023-11-30 à 15.02.39.png

 

Now I would like to set a link that will direct to pages/creators/name_of_creator, but the link option just proposes me to select a specific creator and not the one linked to the product

 

Capture d’écran 2023-11-30 à 15.02.51.png

 

Thank you for the help.

 

Jerry

Reply 1 (1)

HH2023
Tourist
3 1 0

I just had a similar inquiry and was able to solve it.

 

Try using this within your link:

/pages/creators/{{block.repeater.name_of_creator.value}}

 

I used "name_of_creator" assuming that's really the key you used for the value you're trying to get.

 

In my case, I wanted to link to a search string that included the "scent name" in order to just show products matching that scent.

 

HH2023_0-1703985670900.png

The above uses this as my link: /search?q={{block.repeater.scent_name.value}}

 

and the resulting link for the "Dew on a Petal" link in the below screenshot is:

/search?q=Dew%20on%20a%20Petal

 

HH2023_1-1703985735575.png