Embedding the Navigation Template
00:00
Now let’s integrate your navigation into the main structure of your website. You use the {% include %}
tag in the base template to include the navigation in your base template.
00:11 It’ll automatically add navigation in all the child templates that have extended from the base template. Let’s see this in action.
00:21
In your base template, just below the <h1>
tag include the _navigation.html
, and since our other pages, that is about.html
and home.html
, extend from base.html
, this navigation should automatically be added to those pages.
00:40 Let’s run this project to verify that it is working.
00:56 Now in the app, home and about navigation will be added, and when you click on About, you are redirected to the About page, and when you click on Home, you are taken to the homepage.
Become a Member to join the conversation.