我对此很新,所以任何帮助都会非常感激。
我正在学习编码并使用模板作为指南,我正在使用此幻灯片模板来创建幻灯片。但问题是,例如,幻灯片显示有四个图像,但只有一个链接按钮,只链接到一个网址。但是,我想编码它,以便我可以将不同的URL链接到四个图像中的每一个。以下是代码......
{% if settings.show_block_lookbook %}
<div id="lookbook-section" class="section-full lookbook-section">
<div class="lookbook-wrapper">
<div class="lookbook-text">
<div class="lookbook-container">
<div class="container">
<div class="lb-text">
{% assign lbText1 = settings.block_lookbook_text_1 %}
{% assign lbText2 = settings.block_lookbook_text_2 %}
{% assign lbText3 = settings.block_lookbook_text_3 %}
{% assign lbText4 = settings.block_lookbook_text_4 %}
{% assign lbLink = settings.block_lookbook_link_1 %}
{% if lbText1 != blank %}<h3>{{ lbText1}}</h3>{% endif %}
<div class="bg-slider-arrows">
<span class="button-prev no-border"></span>
<span class="button-next no-border"></span>
</div>
{% if lbText2 != blank %}<h2>{{ lbText2 }}</h2>{% endif %}
{% if lbText3 != blank %}<p>{{ lbText3 }}</p>{% endif %}
{% if lbText4 != blank %}<a href="{{ lbLink }}" class="btn btn-custom btn-lb">{{ lbText4 }}</a>{% endif %}
</div>
</div>
</div>
</div>
</div>
<div class="lookbook-bg">
{% for i in (1..4) %}
{% assign newShow = 'block_lookbook_img_' | append: i %}
{% if settings[newShow] %}
{% assign newImage = 'block_lookbook_img_' | append: i %}
<div class="lookbook-item">
<img src = "{{ newImage | append: '.jpg' | asset_url}}" alt="" />
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
简单地说,如果我想要制作它以便我可以为每个图像添加不同的URL,那么代码是什么。我已经尝试过并试过但无济于事,所以如果有人可以提供代码示例,我们将不胜感激......