Shopify / Shopify/liquid

How to output file (image) alt form Files in Shopify

Open
#1,690 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
11.9k
Forks
1.5k
Avg merge
17h 55m
Merged PRs (30d)
3

Description

Hello
Im looking for the possibility to output image_alt for the image uploaded into Files
I do have incremental loop to output custom images and everything works like a charm
I added text alt to the images in Files, but have to idea hot to display it as a text under the images
Images are there - please see come

{% for i in (1..51) %}
{% capture code_img %}{{ handle }}_{{ i }}.jpg{% endcapture %}
{% assign mod = forloop.index | modulo: 37 %}

{%- liquid
case mod
xxxxxx all my cases here within layout
endcase
%}

{{ code_img | file_url | img_tag }} ////////Thats where I need to output img_alt somehow as a variable something like {{ code_img.alt}}??? {% endfor %}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Liquid filters shown in the example, especially file_url and img_tag, and determine whether file metadata is available to the template. The issue does not name a source file or test, and it has no comments or linked pull request. Done would mean establishing whether alt text for Files can be accessed and documenting or implementing the supported behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.