Merging Content Sources, Pages::Factory, status listed/unlised

Hey!

In the Merging content sources | Kirby CMS Docs
I found this:

            // No need to check for existing pages here. We can
            // simply assume that some of them already exist on disk
            // while others do not yet exist.
            $page = Page::factory([
                'slug'     => $slug,
                'template' => 'animal',
                'model'    => 'animal',
                'parent'   => $this,
                'num'      => 0, /* <-- this here is the problem */
            ]);

I updated my website and later found out that the 'num' => 0 leads to folders like this:

content/3_theater/1_programm/83_parrentpage/0_2016-107226 content/3_theater/1_programm/83_parrentpage/0_2016-107228 content/3_theater/1_programm/83_parrentpage/0_2016-107229 content/3_theater/1_programm/83_parrentpage/0_2016-108156

the problem is the 0_… (leading zero), that makes the pages technically public, but I want them to be unlisted.

When I remove the 'num' => 0, the merge doesn’t seem to work as intended anymore.
So I guess it’s now necessary to list those pages?

Maybe someone has an answer.

Have you tried to set 'draft' => false instead of the num prop?

Hey,

thank you for you answer.

I removed the num prob
// 'num' => 0,
and then switched the $kirby Content and Virtual Content merge:


        return [
            ...$content,
            ...$this->readVirtual($versionId, $language), 
        ];


# was before: 
#
#        return [
#            ...$this->readVirtual($versionId, $language),
#            ...$content,
#        ];
#

*/

I can’t really tell why it works … but it works! (at least for now).