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 4171628
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T00:28:02+00:00 2026-05-21T00:28:02+00:00

I have the following structure of templates (simplified for clarity): base1.html : <html> <head>{%

  • 0

I have the following structure of templates (simplified for clarity):

base1.html:

<html>
    <head>{% block head %}{% endblock %}</head>
    <body>{% block body %}{% endblock %}</body>
</html>

base2.html:

{% extends "base1.html" %}
{% block head %}
    <meta .... />
    <title .... />
    css includes etc.
{% endblock %}
{% block body %}
    {% block header %}{% endblock %}
    {% block featured %}{% endblock %}
    {% block navigation %}{% endblock %}
    {% block content %}{% endblock %}
    {% block footer %}{% endblock %}
{% endblock %}

Also base3.html and base4.html which futher detalize the generic body structure defined in previous base templates (not shown here). The last template extends base4.html, overriding blocks with concrete content (markup is handled by base templates).

The question is: I have two templates: main.html and article.html which both extend base4.html. But in article.html I want the order of body blocks defined in base2.html to be different (featured block to go after navigation). How can I achieve that? Or how to refactor the structure of templates to make this possible? Overriding the block body in top-level template doesn’t work.

  • 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-21T00:28:02+00:00Added an answer on May 21, 2026 at 12:28 am

    I don’t think that you’re going to have any luck going about it that way. A simple solution could be to have an optional variable that base2.html looks at, which determines the alternate order. In fact it may even be that you can define the presence of this variable in the article.html template itself. I haven’t tried this, but something like the following may work:

    {% with alternate_order=1 %}
        {% include base4.html
    {% endwith %}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following structure /templates/base.html templates/index.html --- here i have inherited base.html which
In my rails view(index.html.erb), i have following structure <div> <%= render :partial => create
I have following data structure (simplified): A giant list of the class TestClass public
I have the following simplified XML structure: <?xml version="1.0" encoding="UTF-8"?> <ExportData> <TransportHeader> <Timestamp>2011-01-16 06:00:33</Timestamp>
I am transforming XML into HTML using XSLT. I have the following XML structure:
I have java application packaged into myApplication.jar having following structure: com mypackages templates ..
I have the following XML structure: <method constructor=true name=Main public=true> <parameterList/> <block> <call> <callAttrbute>
I have the following folder structure for the templates on my django app: templates/
I have the following structure. <div> <p>Hello World !!</p> </div> <iframe id="myiframe" src='myiframeContent.html'></iframe> and
I have following structure with example data: id season_id title 1 1 Intro 2

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.