0

我目前正在为 Bigcartel 网站自定义主题“Sidecar”,并尝试添加一个下拉菜单,该菜单仅填充固定侧边栏上的 Artist 链接。

我试过只使用简单的代码来包围,但这似乎不起作用。除了下图之外,它不会下拉或显示任何内容。

任何人都可以帮忙吗?

在我添加下拉列表之前 - https://db.tt/gYoAFdW3

然后在我应用下面的代码之后 - https://db.tt/w3UFxzoA

{% if artists.active != blank %}
    <section>
        <h2 class="title">Artists</h2>
        <select>  
            <ul>
                {% for artist in artists.active %}
                    <li>
                        <a href="{{ artist.url }}" class="page {% if page.full_url contains artist.url %}current{% endif %}">
                            {{ artist.name }}
                        </a>
                    </li>
                {% endfor %}
            </ul>
        </select>
    </section>
{% endif %}
4

1 回答 1

1
  {% if artists.active != blank %}
    <section>
      <h2 class="title">Artists</h2>
       <select onchange="location = this.options[this.selectedIndex].value;">  
         {% for artist in artists.active %}
        <option value="{{ artist.url }}">{{ artist.name }}</option>
        {% endfor %}
      </select>
    </section>
  {% endif %}
于 2014-05-26T22:27:44.933 回答