I have a structure section, where the last child should be an anchor in the slug:
parent/parent#child
I'm trying to setup conditional url formats on nested entries as such:
{parent.uri}{% if object.getDescendants().total() != 0 %)/{% else %}#{% endif %}{slug}
I've also tried the simpler
{parent.uri}{% if object.hasDescendants %)/{% else %}#{% endif %}{slug}
but keep getting stuck tasks when re-saving entries. Can someone tell me what I'm doing wrong? Thanks in advance
craft/storage/runtime/logs
.[error] [application] Encountered an error running task 18 (ResaveElements), step 2 of 39: An exception was thrown while trying to save the Entry with the ID “19”: Unexpected ")" in "{{object.parent.uri|raw}}{% if object.getDescendants().total() != 0 %)/{% else %}#{% endif %}{{object.slug|raw}}" at line 1.