question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How Does the Meta Block in Base Template Work?

See original GitHub issue

Description

I am confused by purpose of the meta block in base.html template code.

Steps to reproduce

  1. Confirm working djangocms-meta setup:
    1. Have working djangocms-blog install.
    2. Have custom djangocms-blog app templates, that still has this code in base.html:
      {% block meta %}
          {%  if meta %}
              {% include "meta/meta.html" %}
          {% endif %}
      {% endblock meta %}
      
    3. Have working configuration for djangocms-meta app. This includes this code in base.html CMS template:
      <head …>
          …
         {% include "meta/meta.html" %}
          …
      </head>
      
  2. Try to break working djangocms-meta setup:
    • Remove the {% block meta %} block of code from base.html app template (not the CMS template).
  3. Try, with more force, to break working djangocms-meta setup:
    • Remove the {% include "meta…" %} line of code from base.html CMS template (not the app template).

Expected result

  1. 💡 The code renders something somewhere.
  2. 💡 Removal of the code does not render something somewhere.
  3. 💡 Removal of the code does not render something somewhere.

Actual result

  1. ✓ The code renders <meta> tags in the <head>.
  2. 🤷‍♂️ Removal of the code seems to render everything the same (as in step 1) everywhere.
  3. ✓ Removal of the code does not render <meta> tags in the <head>.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
yakkycommented, Aug 26, 2020

awesome!

i updated #630 to fix the base template

Thanks a lot for your patience and your super detailed reports!

0reactions
yakkycommented, Aug 26, 2020

@tacc-wbomar thanks again. Closing this via merge of #630

Read more comments on GitHub >

github_iconTop Results From Across the Web

Base Templates and Blocks - Hugo
The block keyword allows you to define the outer shell of your pages' one or more master template(s) and then fill in or...
Read more >
how can I use multiple {% block content %} inside base ...
That is, a block tag doesn't just provide a hole to fill – it also defines the content that fills the hole in...
Read more >
Django Block Content - Vegibit
The block tag is used to define a block that can be overridden by child templates. In other words, when you define a...
Read more >
Template Inheritance — Flask Documentation (2.2.x)
Template inheritance allows you to build a base “skeleton” template that contains all the common elements of your site and defines blocks that...
Read more >
extends - The flexible, fast, and secure PHP template engine
You can't define multiple block tags with the same name in the same template. This limitation exists because a block tag works in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found