3

stack community I'm completely an amateur in HTML, Liquid, Adx, in short programming and applying logic, don't have great understanding.

Im not sure why the <span> Test2 </span> is appearing 2x, as you can see from the image,enter image description here

I want to achieve the following, Test2 new name? as one text and the left Test2 don't want it to be displayed. Please advise.

    {% assign homeurl = website.adx_partialurl %}
    
    <div class="navbar navbar-inverse navbar-static-top" role="navigation">
      <div class="container">
        <div id="navbar" class="navbar-collapse collapse">
          {% assign primary_nav = weblinks["Primary Navigation"] %}
          {% if primary_nav %}
            <div class="data-weblinks-maxdepth=""> 
              <ul class="nav navbar-nav weblinks" role="menubar"> 
                {% for link in primary_nav.weblinks %} 
    
                  <li role="none" class="weblink {% if sublinks.size > 0 %} dropdown{% endif %}">
                    <a role="menuitem" aria-label="{{ link.name | escape }}" {%- if link.tooltip %} title="{{ link.tooltip | escape }}"
                    {% endif %}>
                       <span> Test2 </span>
                        {%- unless link.display_image_only -%}
                          {{ link.name | escape }}
                        {%- endunless -%}
    
                    </a>
    
                  </li>
    
                {% endfor %}
    
              </ul>
              {% editable primary_nav %}
            </div>
          {% endif %}
    
        </div>
      </div>
    </div>
OshiniRB
  • 578
  • 1
  • 7
  • 21
user12403387
  • 174
  • 9

1 Answers1

1

To change the name of the link and perhaps add something in front of it all you have to do is add something into the if clause like below:

{% assign homeurl = website.adx_partialurl %}

<div class="navbar navbar-inverse navbar-static-top" role="navigation">
  <div class="container">
    <div id="navbar" class="navbar-collapse collapse">
      {% assign primary_nav = weblinks["Primary Navigation"] %}
      {% if primary_nav %}
        <div class="data-weblinks-maxdepth=""> 
          <ul class="nav navbar-nav weblinks" role="menubar"> 

            {% for link in primary_nav.weblinks %} 
              <li role="none" class="weblink {% if sublinks.size > 0 %} dropdown{% endif %}">
                <a role="menuitem" aria-label="{{ link.name | escape }}" {%- if link.tooltip %} title="{{ link.tooltip | escape }}"{% endif %}>
                  {%- unless link.display_image_only -%}
                    Text 2 {{ link.name | escape }}
                  {%- endunless -%}
                </a>
              </li>
            {% endfor %}

          </ul>
          {% editable primary_nav %}
        </div>
      {% endif %}

    </div>
  </div>
</div>
Dominik
  • 6,078
  • 8
  • 37
  • 61