showing a collection title chosen in product metafield, and jumping to the collection. possible?

Ignasi
New Member
4 0 0

I created a metafield of collection select type with namespace and key : "product.metafields.custom._collection-pick".

I want to create a textblock on product detail page that displays the title of the selected collection on the product page and when clicked on the title jumps to that collection page.

Please help mine~

Replies 6 (6)

Dirk
Shopify Staff
2301 253 514

Hey, @Ignasi 

 

Happy to lend a hand here and point you in the right direction. Do you have an example that you could share (link or screenshot) that highlights what you're exactly looking to accomplish?

We can go from there! If there is anything else I can help you with, please let me know.

Dirk | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Ignasi
New Member
4 0 0

스크린샷 2023-08-01 오후 1.18.26.png

Yap, this is what I want. hope you get it clearly.

perfectiongeeks
Visitor
1 0 0

 Perfectiongeeks is one of the best award-winning app development companies in India, USA, and Singapore for Startups and Enterprises. Call now!

perfectiongeeks
Ignasi
New Member
4 0 0

Mitchellhobb, first of all, you said 'it's possible', which gave me hopp^^.

However, I still can't take any action with the above description alone.

 

If there's one hint, I am using Shopify's Baseline theme.

 

Could you please give me some clearer code?

Shafiqul_dot_me
Shopify Expert
8 0 0
{% assign custom_collection = product.metafields.custom.collection_name.value %} 
{% comment %}
  {{ custom_collection.title }} - returns collection title  
  {{ custom_collection.url }} - returns collection URL 
{% endcomment %}
<a href="{{ custom_collection.url }}">
  {{ custom_collection.title }}
</a>
Shafiqul Islam
Shafiqul_dot_me
Shopify Expert
8 0 0

 

 

{% assign custom_collection = product.metafields.custom.collection_name.value %} 
{% comment %}
  {{ custom_collection.title }} - returns collection title  
  {{ custom_collection.url }} - returns collection URL 
{% endcomment %}
<a href="{{ custom_collection.url }}">
  {{ custom_collection.title }}
</a>

 

 

 
Shafiqul Islam