Navigation in django

后端 未结 30 1505

I\'ve just done my first little webapp in django and I love it. I\'m about to start on converting an old production PHP site into django and as part its template, there is a

30条回答
  •  伪装坚强ぢ
    2020-11-27 09:46

    This is just a variant of the css solution proposed by Toba above:

    Include the following in your base template:

    
    

    Then in your templates that extend the base use:

    {% block section %}show{% endblock %}
    

    You can then use css to highlight the current area based on the body tag (for example if we have a link with an id of nav-home):

    #section-home a#nav-home{
     font-weight:bold;
    }
    

提交回复
热议问题