Specify folder/path when creating a new draft

Normally we have the parent pages in our panel dashboard (site.yml). But for this particular project it makes sense to have the child (book) pages of parent (books) on the main dashboard page instead. All that is fine when showing the listed pages using the splendid pagesdisplay plugin with a query.

But of course we want to add new items (books - children of /books) from here as well. So we set up a unlisted section with the correct template (book). But when we create files they are created in the root/home folder rather than the desired ‘books’ folder. Is there anyway to set this?

You have to set the parent property.

Hi pixelijn, thanks for the reply. If I set the ‘parent:’ on the drafts section I get an error. I basically want to set the drafts into ‘/books’ not the root. Any ideas?

"The section ‘drafts’ could not be loaded: The parent for the query 'books cannot be found in the section ‘drafts’

        sections:
          drafts:
            extends: sections/default-item
            headline: New Book/Drafts
            status: drafts
            empty: Add new Book
            template: book
            parent: books
....

Have you tried this (if your URL is also books)

parent: site.find("books")

Exactly, you have to set a page object, not just a string.

Many thanks, that fixed it.