2

I'm trying to set a title for a STRUCTURE entry dynamically based on the structure level within the section hierarchy.

{% if entry.level('not 1') %}{ postDate|date('M') }{% else %}{ postDate|date('Y') }{% endif %}

I've tried using the above for the title format of my entry type but it only appears to work for setting YYYY for the parent entry and doesn't add the month for child entries.

2

I resolved the issue by using the following code for my title format

{% if object.parent %}{ postDate|date('M') }{% else %}{ postDate|date('Y') }{% endif %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.