Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

商品一覧・商品詳細ページの商品画像 imgタグに、alt属性を追加 #5058

Merged
merged 2 commits into from Jul 2, 2021

Conversation

matsuoshi
Copy link
Contributor

@matsuoshi matsuoshi commented Jun 8, 2021

概要(Overview・Refs Issue)

フロントの商品一覧・商品詳細ページの商品画像 imgタグに、alt属性を追加する
alt属性の値は商品名としています

関連issue
#5052

方針(Policy)

実装に関する補足(Appendix)

テスト(Test)

相談(Discussion)

マイナーバージョン互換性保持のための制限事項チェックリスト

  • 既存機能の仕様変更
  • フックポイントの呼び出しタイミングの変更
  • フックポイントのパラメータの削除・データ型の変更
  • twigファイルに渡しているパラメータの削除・データ型の変更
  • Serviceクラスの公開関数の、引数の削除・データ型の変更
  • 入出力ファイル(CSVなど)のフォーマット変更

レビュワー確認項目

  • 動作確認
  • コードレビュー
  • E2E/Unit テスト確認(テストの追加・変更が必要かどうか)
  • 互換性が保持されているか
  • セキュリティ上の問題がないか

@matsuoshi matsuoshi added the affected:template フロントテンプレートの変更 label Jun 8, 2021
@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2021

Codecov Report

Merging #5058 (63c0629) into 4.1-feature (60f8669) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff               @@
##             4.1-feature    #5058   +/-   ##
==============================================
  Coverage          76.38%   76.38%           
  Complexity          6190     6190           
==============================================
  Files                445      445           
  Lines              20963    20963           
==============================================
  Hits               16013    16013           
  Misses              4950     4950           
Flag Coverage Δ
tests 76.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60f8669...63c0629. Read the comment docs.

@chihiro-adachi
Copy link
Contributor

確認しました。
問題ないかと思います。

@k-yamamura
Copy link
Contributor

商品詳細画面の以下の箇所ですが、

{% for ProductImage in Product.ProductImage %}
    <div class="slide-item"><img src="{{ asset(ProductImage, 'save_image') }}" alt="{{ Product.name }}"></div>
{% else %}
    <div class="slide-item"><img src="{{ asset(''|no_image_product, 'save_image') }}" alt="{{ Product.name }}" /></div>
{% endfor %}

画像が少なければ余り問題ありませんが、画像が多いと同一のalt内容が使われることになるので好ましくありません。
解決方法は1枚目だけにaltを入れるとかになりそうです。

サムネイル部分の

{% for ProductImage in Product.ProductImage %}
    <div class="slideThumb" data-index="{{ loop.index0 }}"><img src="{{ asset(ProductImage, 'save_image') }}" alt="{{ Product.name }}"></div>
{% endfor %}

は、 alt="" だけでも問題ないかと思います。

@matsuoshi
Copy link
Contributor Author

@k-yamamura コメントありがとうございます!
ご指摘反映しまして、1枚目の商品画像 alt にのみ商品名を入れ、その他サムネイルは alt="" とするようにしました

@chihiro-adachi お手数ですが再度確認おねがいします!

@chihiro-adachi chihiro-adachi merged commit 6d824a0 into EC-CUBE:4.1-feature Jul 2, 2021
@chihiro-adachi
Copy link
Contributor

@matsuoshi
ありがとうございます、マージしました

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected:template フロントテンプレートの変更 Status: ready-for-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants