create:
title: "{{ page.city }}, {{ page.name }}"
slug: "{{ page.name.slug }}-{{ page.city.slug }}"
fields:
- name
- city
I type a name and a city in the page create modal and the page is created with the correct slug. but when I do it again, with same name and city, the page is overwritten (no warning, I just arrive in an empty blueprint and the content txt-file from before is gone) instead of adding a slug with a trailing number.
Is this normal and do I have to write my own page.create:before hook to prevent this?
I tested it with a fresh starterkit.
I added the create from above to the note.yml and added city and name fields (type: text) to the blueprint. → Same thing!
But I noticed, that it is only happening, if the page is still a draft. When I set it to unlisted and try to create a page with same values, I get the error message you provided. Did you change the status to listed/unlisted before creating the new page?
And another strange thing happend: After deleting a page where I also had a files section and uploaded an image, the _draft/slug/ still existed, with a image.png and image.png.txt inside, without the template.txt file. So I did not see the page in the panel anymore, but when I tried to create a page with name name/city values, I got an error that a page with the URL appendix already exists. Is there a case, when that should happen? (sorry, thats probably another issue?!)