-
Notifications
You must be signed in to change notification settings - Fork 191
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
How Does the Meta Block in Base Template Work? #613
Comments
@tacc-wbomar could you check if the documentation and comment added in #628 helps clarifying the social meta tags behavior and the role of the |
Yes. The (I will try out the "complete social meta tag rendering", like
|
Regarding
Update: I stumbled upon the docs for these settings. I could not find them in the |
After experimenting with Setup
Problems1. Page Meta: Making it Work (with Blog Meta?)
ProblemUsing Workaround
I do not remember from where I copied/learned the pieces of the workaround code. 2. Logic: Overwrite Block Even If There Is No
|
@tacc-wbomar this further documentation update should help clarify the proper template layout #630 djangocms-page-meta documentation is actually outdated and I will amend that as well I also included your suggestion at point 2 Regarding point 3, blog overrides page meta on purpose as you can't have both |
check updated documentation https://djangocms-blog--630.org.readthedocs.build/en/630/features/meta.html and updated settings documentation https://djangocms-blog--630.org.readthedocs.build/en/630/autodoc/settings.html (which is not updated on RTD due to a build failure) |
Thank you. Status
Expected Result
Actual Result
WorkaroundMove Meta Include Logic From
|
Is my Expected Result strange? Perhaps, Blog page should not have page metadata. I really don't understand how users use social media, I'm just trying to get the metadata present on all the pages so I can complete implementation of our blog/news/social-media-metadata feature. |
@tacc-wbomar I don't understand if you can see any metadata in the post detail view, or you can see the blog post ones and not the CMS page If you can't see any metadata, that's of course an issue because the it's the whole point of the django-meta integration :) I will try to replicate the issue in the https://github.com/yakky/djangocms-blog-poc repo |
With the documented setup, I do not see any meta tags on the CMS's Blog page (I see meta tags on Home page, and on a Blog post page). I think this is all the relevant info to show my setup. If helpful, I'll include bits of Variations
|
@tacc-wbomar the settings and a |
Okay.
|
thanks for the details Can you try replacing in {% block meta %}
{% comment %}
This is needed if you can't add ``{% include "meta/meta.html" %}`` in the django CMS template attached to the blog
page.
If you have something like the snippet below in the main template used by the django CMS page, you don't need
this block and you can safely remove it when customizing the blog templates
...
<html>
<head>
<title>{% block title %}{% page_attribute 'title' %}{% endblock title %}</title>
{% include "meta/meta.html" %}
...
{% endcomment %}
{% if meta %}
{% include "meta/meta.html" %}
{% endif %}
{% endblock meta %} with {% block meta %}
{% if meta %}
{% include "meta/meta.html" %}
{% else %}
{{ block.super }}
{% endif %}
{% endblock meta %} |
Yes! That works. |
awesome! i updated #630 to fix the base template Thanks a lot for your patience and your super detailed reports! |
@tacc-wbomar thanks again. Closing this via merge of #630 |
Description
I am confused by purpose of the
meta
block inbase.html
template code.Steps to reproduce
djangocms-meta
setup:djangocms-blog
install.djangocms-blog
app templates, that still has this code inbase.html
:djangocms-meta
app. This includes this code inbase.html
CMS template:djangocms-meta
setup:{% block meta %}
block of code frombase.html
app template (not the CMS template).djangocms-meta
setup:{% include "meta…" %}
line of code frombase.html
CMS template (not the app template).Expected result
Actual result
<meta>
tags in the<head>
.<meta>
tags in the<head>
.The text was updated successfully, but these errors were encountered: