2012-11-08 38 views
0

我想在pinax中添加新的鏈接到standart bootstap主題。我試圖實現在我的網站:如何將鏈接添加到導航pinax(0.9a2)?

{% block nav %} 
    {% if user.is_authenticated %} 
     <ul>{% spaceless %} 
      <li id="tab_profile"><a href="{% url profile_detail user.username %}">{% trans "Profile" %}</a></li> 
      <li id="tab_notices"><a href="{% url notification_notices %}">{% trans "Notices" %}{% if notice_unseen_count %} ({{ notice_unseen_count }}){% endif %}</a></li> 
     {% endspaceless % 
      <li id="tab_first"> 
       <a href="#">First Link</a> 
      </li> 
     }</ul> 
    {% endif %} 
{% endblock %} 

,但我得到一個錯誤:

TemplateSyntaxError at /

Invalid block tag: 'endif', expected 'endspaceless'

因此,如何將新的鏈接添加到導航欄?

回答

2

你有一個語法錯誤,你沒有正確終止endspaceless

{% endspaceless % 
    <li id="tab_first"> 
     <a href="#">First Link</a> 
    </li> 
}</ul> 

應該是:

{% endspaceless %} 
    <li id="tab_first"> 
     <a href="#">First Link</a> 
    </li> 
</ul> 
相關問題