shopifyshopify-template

Using shortcode in theme customization alias - Shopify Theme


Old version of theme used in section Product Short Description a shortcode from product description that was write like this:

Product > Description (Rich Text block):

[short_description]
...
[/short_description]

[description]
...
[/description]

And it's pasted to specific section in theme correctly. And not displayed in Description section below.

In new version they replaced shortcodes by alias, so now it's require metafileds (ex. {{ product.metafields.meta.product_excerpt }}).

Theme metafileds

But in editor it's quite hard to edit content.

I tried to get the old shortcode by using something like:

{{ product.description.short_description }}

or

{{ product.description.value[short_description] }}

But there is no result for it. It is possible to use this kind of shortcodes in alias?


Solution

  • The solution for this can be using in template this rules:

    product.description | split: '[short_description]' | last | split: '[/short_description]' | first
    

    Maybe will be useful for someone.