Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add header and footer to default base template #609

Open
john0isaac opened this issue Feb 22, 2024 · 9 comments
Open

Add header and footer to default base template #609

john0isaac opened this issue Feb 22, 2024 · 9 comments
Labels
enhancement New feature or request good first issue Good for newcomers jinja template

Comments

@john0isaac
Copy link
Contributor

Render engine has a default base.html template that gets rendered if you don't have a _base.html template

currently it's missing the html header and footer tags.
Need to add them to match _base.html template

Cc: @kjaymiller

@john0isaac john0isaac added the enhancement New feature or request label Feb 22, 2024
@Mahhheshh
Copy link
Contributor

The base.html extends all the HTML from base_templates/_base.html so there is no need to explicitly define the headers and footer in the base.html file.

@kjaymiller
Copy link
Collaborator

@Mahhheshh is correct.

This is the components of _base.html

  <body {% if body_class is defined %}class="{{"".join(body_class)}}"{%endif%}>
        {% block header %}{% endblock %}
        {% block page_title %}{% endblock %}
        {% block content %}{% endblock %}
        {% block footer %}
        {% endblock %}
    </body>

We may need to check the template used on render_engine_init to make sure that it isn't overriding the base.

@kjaymiller
Copy link
Collaborator

@all-contributors please add @john0isaac for Maintenance UserTesting
@Mahhheshh maintenance

Copy link
Contributor

@kjaymiller

I've put up a pull request to add @john0isaac! 🎉

@kjaymiller
Copy link
Collaborator

@all-contributors please add @Mahhheshh for maintenance

Copy link
Contributor

@kjaymiller

I've put up a pull request to add @Mahhheshh! 🎉

@kjaymiller
Copy link
Collaborator

Looking at the base template from - https://github.com/render-engine/cookiecutter-render-engine-site/blob/main/%7B%7Bcookiecutter.project_slug%7D%7D/templates/_base.html

It seems like it is setup as expected with references to header and footer.

@kjaymiller kjaymiller closed this as not planned Won't fix, can't repro, duplicate, stale Feb 24, 2024
@john0isaac
Copy link
Contributor Author

john0isaac commented Feb 24, 2024

@kjaymiller I think you forgot about this issue it wasn't with the cookie cutter base template.
You told me to remove the _base.html and render engine serve will use the default base.html. It didn't. It rendered a page without header and footer.

this happened during our small meeting.

the problem is that the default base.html is what's missing the header and the footer as I have explained not the cookiecutter template.

Not related to cookiecutter template related to here.

@Mahhheshh this is not related to a redefinition issue it's related to missing content from the default base.html that gets used when there is no _base.html.

This one. ==> https://github.com/render-engine/render-engine/blob/main/src/render_engine/render_engine_templates/base_templates/_base.html

Should match this one. ==> https://github.com/render-engine/cookiecutter-render-engine-site/blob/main/%7B%7Bcookiecutter.project_slug%7D%7D/templates/_base.html

@john0isaac john0isaac reopened this Feb 24, 2024
@kjaymiller
Copy link
Collaborator

You're correct. Interesting enough I think there are some things that we cxan do if we plan this out a bit.

I'm sure we can plan this out and get to a good solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers jinja template
Projects
Status: No status
Development

No branches or pull requests

3 participants