0

I am using Aldryn Newsblog for article management on a website built on Django CMS.

Aldryn allows us to add meta options to each article, please refer to picture.

My inputs for meta title and meta description are not showing in the webpage page source.

Will like to seek help for this please, thank you.

hzh
  • 41
  • 1
  • 6

2 Answers2

1

The {% page_attribute %} tag is used by the cms to render the page's meta and other properties. This tag will not work for newsblog articles as they are a different object.

I suggest to wrap the {% page_attribute "meta_description" %} call in a block on your page base template:

{% block meta %}
    <meta name="description" content="{% page_attribute 'meta_description' %}">
{% endblock meta%}

Then in your article base template you can do something like:

{% block meta %}
    {% if article %}
        {# rendering article detail page #}
        <meta name="description" content="{{ article.meta_description }}">
    {% else %}
        {# rendering article landing page #}
        {{ block.super }}
    {% endif %}
{% endblock meta%}
Paulo
  • 6,982
  • 7
  • 42
  • 56
0

Do you have these lines inside <head>...</head> of your base.html?

{% page_attribute "page_title" as title %}
<title>{{ title }}</title>

and

<meta name="description" content="{% page_attribute "meta_description" %}">
Marcelo Cordeiro
  • 320
  • 2
  • 12
  • Thanks Marcelo. Yes I do have both pieces of code. The meta information currently reflects that set for my aldryn newsblog section (attached below is a link to describe what is a section). I will like the meta information to reflect that set for the article instead. http://aldryn-newsblog.readthedocs.io/en/latest/how-to/apphook_configurations.html – hzh Nov 12 '17 at 02:48