locomotivecms/engine

with_scope: replace _permalink by _slug in the query

did opened this issue · 1 comments

did commented

using "with_scope :_permalink" makes the mongodb query fail because only the _slug field exists (not _permalink).
The solution is to parse the parameters of the with_scope tag and replace _permalink by _slug.

I don't know if this is linked to this issue.
I have a block inside the body tag of my page layout so that a content type can insert an id on the body tag.

{% block 'body_attributes' %}{% with_scope _permalink: rubrique.section_slug %}id="{{ contents.sections.first.body_id }}"{% endwith_scope%}{% endblock %}

This code works fine in the editor, but in my locomotive site I have to change _permalink by _slug to make it work.

{% block 'body_attributes' %}{% with_scope _slug: rubrique.section_slug %}id="{{ contents.sections.first.body_id }}"{% endwith_scope%}{% endblock %}