Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6344521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:39:19+00:00 2026-05-24T20:39:19+00:00

Apologies, this is pretty basic. I have abstracted my static html navigation bar to

  • 0

Apologies, this is pretty basic. I have abstracted my static html navigation bar to a block so that it can be dynamically rendered from a model. I have created a new block marker in base.html with the following syntax

{% block navigation %}{% endblock %}

How can I ensure this is rendered on every page? Do I need to create some sort of middle layer for this? Everything I have done so far has simply used the primary block.

EDIT Sunday, 14 August 2011 11:25 AM

I didn’t explain this very well. The content of navigation block is

{% extends 'base.html' %}

{% block navigation %}

<nav>
    <ul>
    {% for item in items %}
        <li><a href="{{ item.url }}">{{ item.name }}</a></li>
    {% endfor %}
    </ul>
</nav>

{% endblock %}

I want to render this on every page without having to go through child templates of base.html individually and add it to them, if that is possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:39:19+00:00Added an answer on May 24, 2026 at 8:39 pm

    You have got static navigation bar, so you can just write code in your base.html page and then use it with {% extends 'base.html' %} tag on every new page. Your markup will be in every page. Also, if you use only extends tag in your child page and then render it – you will see base.html without any edition.

    If you have got code, which need to appear on few pages, but not on everyone – create ‘includes’ directory, save code there and extend your base template with {% include %} tag. It won’t avoid repating, but make your code shorter.

    And last thing you’ll need in future, maybe with dynamic code – caching. With {% cache %} tag you can cache block for some time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This, I'm sure is a pretty basic question about JavaScript, so apologies in advance.
Apologies if this was already asked but, I have had a look and can't
Apologies for making this my second Z80 DAA question - I have pretty much
I'm pretty new to C# and asp.net so apologies if this is a really
I'm probably totally betraying my ignorance at this point, but I have pretty much
My apologies if this is too subjective of a question. I have a theory
I will see if I can explain this clearly enough. I have 2 web
Apologies if this conflicts with a previous post of mine, but I am pretty
Apologies if this is a simple question, I'm still pretty new to this, but
This is a pretty simple question, and it's blatantly my own newb status that's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.