parent
1f7d0afe33
commit
1e9597f701
@ -61,7 +61,8 @@ Estilo aplicado, *vista escritorio*
|
||||
![responsive](https://gitea.kickto.net/jp.av.dev/intro_Django/raw/branch/master/ProyectoWeb/wikimg/responsive.png)
|
||||
|
||||
|
||||
## Modificar Templates, para usar herencia
|
||||
## Herencia de Plantillas y estructura del sitio
|
||||
### Modificar Templates, para usar herencia
|
||||
|
||||
|
||||
### Creación plantilla base
|
||||
@ -93,4 +94,31 @@ e indicar **herencia** de **base.html**
|
||||
...
|
||||
{% endblock %}
|
||||
```
|
||||
## Herencia de Plantillas y estructura del sitio
|
||||
|
||||
### Barra de navegacion, destacar sitio en visita
|
||||
**base.html** `{% if request.path == '/' %}active{% endif %}`
|
||||
```
|
||||
...
|
||||
<div class="collapse navbar-collapse" id="navbarResponsive">
|
||||
<ul class="navbar-nav mx-auto">
|
||||
<li class="nav-item {% if request.path == '/' %}active{% endif %} px-lg-4">
|
||||
<a class="nav-link text-uppercase text-expanded" href="{% url 'Inicio' %}">Inicio</a>
|
||||
</li>
|
||||
<li class="nav-item {% if request.path == '/servicios' %}active{% endif %} px-lg-4">
|
||||
<a class="nav-link text-uppercase text-expanded" href="{% url 'Servicios' %}">Servicios</a>
|
||||
</li>
|
||||
<li class="nav-item {% if request.path == '/tienda' %}active{% endif %} px-lg-4">
|
||||
<a class="nav-link text-uppercase text-expanded" href="{% url 'Tienda' %}">Tienda</a>
|
||||
</li>
|
||||
<li class="nav-item {% if request.path == '/contacto' %}active{% endif %} px-lg-4">
|
||||
<a class="nav-link text-uppercase text-expanded" href="{% url 'Contacto' %}">Contacto</a>
|
||||
</li>
|
||||
<li class="nav-item {% if request.path == '/blog' %}active{% endif %} px-lg-4">
|
||||
<a class="nav-link text-uppercase text-expanded" href="{% url 'Blog' %}">Blog</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
...
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user