How to get children in Django-CMS

239 views
Skip to first unread message

WrapTheCode

unread,
Mar 12, 2020, 8:04:11 AM3/12/20
to Django users
Hi i have a problem with displaying children fields in a parent template.

For example the parent page is a "Services" and child pages is single service.
All i want to do is display all service in a services container.

I have had tried:
{% for child in children %}
{{ child.title }}
{{ child.description }}
{% endfor %}

This code gives me all pages in project(i want only children of services page) and no descriptions.

Thank you very much for any help.

//Django-CMS

WrapTheCode

unread,
Mar 13, 2020, 6:50:08 AM3/13/20
to Django users
I found a solution. Maybe someone else will get help.

{% for child in request.current_page.get_child_pages %}
{{ child.get_menu_title }}
{% page_attribute "meta_description" child %}
{% endfor %}
Reply all
Reply to author
Forward
0 new messages