Alt tag auto fill question re code

Hello I am of course a noob.

I would like alt tags to prefil the items titles

I found this code in my theme:

“image”: “https:{{ ZNEHRFCCKR.image | default: product.featured_image | img_url: ‘master’ }}”,

Of which I need to change to be similar to this:

{{ product.featured_image | image_url }} with this code: {{ product.featured_image.alt }}

They also include this note:

  • Note: If your theme is using product.title for alt text, it may have been automatically set by a previous theme update or a simple code snippet. You can replace {{ product.title }} with {{ media.alt }} or {{ image.alt }} in your theme’s code to pull from the specific alt text field you’ve entered in the Shopify admin instead. I tried to change it, but upon saving it state an unexpected character so I am hoping for someone cleverer than me’s guidance.

I look forward to hearing from you and I don’t take your kind assistance for granted.

Hi @bekwud2 :waving_hand: The simplest way to have alt-txt be the actual product title is to just use the product CSV import and fix this as the actual product data level.

Beyond that unfortunately your post isn’t very clear in what your trying to do the way you’ve structured the description vs title , or edited/formatted/redacted? the example code, and what seems to be a missing image.
:clipboard: take your time re-read your post and see how it needs to be improved so your communicating ideas to OTHER people in a clear way.


Code like the following is specifically to serve the image asset itself through a URL.
it is NOT for a product title or alt txt:

{{ image | default: product.featured_image | img_url: ‘master’ }}

For the alt txt your already showing you know what it is : {{ product.featured_image.alt }} etc
And what a product title looks like {{ product.title }}

:clipboard: So if your trying to swap the two things just backup your theme then look through the themes files for matching code.

How do I “ The simplest way to have alt-txt be the actual product title is to just use the product CSV import and fix this as the actual product data level.”

As for the redacted text, it was not redacted when I typed it and I did not insert an image so I don’t know why it did not send correctly.

Many other people have added code to do what I am asking about so idk

Read the friendly manual
https://help.shopify.com/en/manual/products/import-export/using-csv

This? “image”: “https:{{ ZNEHRFCCKR.image | default: product.featured_image | img_url: ‘master’ }}”
“ZNEHRFCCKR” is what was redacted output by the forum software???
Regardless that parts for serving images and should be irrelevant for swapping titles and alt.txt.

Then use that code, or take the time to explain and reference what you are talking about.
Your not going to get very far if you don’t help others help you.