Re: Rich Text Link Generation

How does the Rich Text section generate a link in code?

Ry_Ellingson
Shopify Partner
3 0 1

Hello!

 

Is there anyone who can explain how the Rich Text section generates a link in the code base? I am using the Motion theme but am interested in a general answer. 

 

 

Reply 1 (1)

PaulNewton
Shopify Partner
7450 657 1562

Content created in the visual theme editor for OS2.0 settings,blocks,sections, template,etc are store in JSON files. ala configurations.

Inspect the file with the settings for that section for the value of the rich text sections content.

i.e if the section is on the frontpage/homepage/index inspect index.json.

URLs in settings are an escaped JSON string,,  because of the slashes or other characters.

i.e in a text block text-setting of a rich text section

"1234567asdfgh": {
  "type": "text",
  "settings": {
    "text": "<p><a href=\"\/collections\" title=\"All collections\">All Collections<\/a><\/p>"
  },
  ...

 

Loosely as if you were creating a URL in a setting info property. https://shopify.dev/docs/themes/architecture/settings/input-settings#create-links 

 

If you don't mean a url within actual rich-text value that is in a rich text section you need to elaborate.

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org