Moving between pages and generating a browser
Visitors need to navigate between different pages; a simple button structure and corresponding logic for loading the appropriate templates will need to be incorporated.
We are going to create a browser to dynamically jump between pages or, in other words, request the backend to render the page in the right place:
- The first step is to create a component with hyperlinks. We create a file in
app/website/templates/components/_nav.html
with the following structure:<ul class="nav__ul"> <li> <a href="#" class="nav__link nav__link nav__link--page{% if active_nav == "all posts" %} active{% endif %}"" ...