I’m trying to create links to metaobjects using the theme editor.
I’m using OS2.0, Broadcast theme, and have created a metaobject accessible via:
{{ product.metafields.custom.my_metaobject }}
and also a URL metaobject to experiment with at:
{{ product.metafields.custom.my_metaobject.value.example_link }}
In the theme editor, while editing a product template, I would to achieve either of the following:
a) Create a link to my_metaobject (ie: https://mystore.my-shopify.com/my_metaobject/abcd)
b) Highlight some text and have the path set to example_link.value
Trying to do something like this as the URL value for a link:
http://abc.com/{{ product.metafields.custom.my_metaobject.value.example_link.system.url }}
or
https://abc.com/{{ product.metafields.custom.my_metaobject.system.url }}
or use
{{ product.metafields.custom.my_metaobject.value.example_link.value }}
In an attempt to create either a link to the metaobject or use the URL field to do something useful returns the errors:
- “Dynamic source ‘product.metafields.custom.my_metaobject.value.example_link.value’ is type: URL. Setting ‘raw_content_1’ can only use types: Text, Integer, Decimal, Measurement, Datetime, Rating, Money, Single-line Text List, Multi-line Text, Rich Text.”
or something along the lines of…
- “Dynamic source ‘product.metafields.custom.my_metaobject.value.example_link.system.url’ is invalid.”
- “Dynamic source ‘product.metafields.custom.my_metaobject.system.url’ is invalid.”
Is there any way to create links in the theme editor without hacking the theme liquid files?
I’d also love to be able to link to the publicly accessible metaobject object pages themselves (eg: myshop.com/my_metaobject/abc) when adding the metaobjects to the rich text fields, but the best I can do is get the title name of metaobject to display, with no way to ever create a link to the metaobject’s own object page.
I’d be happy with either a way to highlight some text and have the URL come from a metaobject URL field, or just insert a metaobject reference and have it link to the metaobject page itself. But currently it seems the only way I can put links into a rich text field is by using a rich text metaobject.
Any tips? The closest I have seen on here is this but it doesn’t seem to apply.
