Deleted a Page, remade but not showing up in my select

I’m making a portfolio website and on the homepage, I have it so that you can select project pages to add to a slideshow. Like so:

Home.yml
<?php if(!defined('KIRBY')) exit ?>

title: Home
pages: false
fields:

  titleline:
    label: Url Information
    type: headline

  title:
    label: Page title (H1)
    type: text
    width: 1

  slideline:
    label: Slideshow Information
    type: headline

  slidetwo:
    label: Slide 2
    type: select
    options: query
    width: 1/2
    query:
      label:
      page: projects
      fetch: children
      value: '{{uri}}'
      text: '{{title}}'
    required: true

  slidetwoimg:
    label: Slide 2 Image
    type: image
    width: 1/2
    required: true


  slidethree:
    label: Slide 3
    type: select
    options: query
    width: 1/2
    query:
      label:
      page: projects
      fetch: children
      value: '{{uri}}'
      text: '{{title}}'
    required: true

  slidethreeimg:
    label: Slide 3 Image
    type: image
    width: 1/2
    required: true

  slidefour:
    label: Slide 4
    type: select
    options: query
    width: 1/2
    query:
      label:
      page: projects
      fetch: children
      value: '{{uri}}'
      text: '{{title}}'
    required: true

  slidefourimg:
    label: Slide 4 Image
    type: image
    width: 1/2
    required: true


  slidefive:
    label: Slide 5
    type: select
    options: query
    width: 1/2
    query:
      label:
      page: projects
      fetch: children
      value: '{{uri}}'
      text: '{{title}}'
    required: true

  slidefiveimg:
    label: Slide 5 Image
    type: image
    width: 1/2
    required: true

The problem is that I accidentally deleted the original projects page. I made a new one with the same projects template but nothing will drop down in the panel field anymore which now throws an error on my homepage because I require the slideshow. Is there a way to fix this?

Does the replacement page have the correct visibility? does your code depend on things being invisible or visible?

Actually I just figured it out. Visibility doesn’t matter, It was that the new page URL was different than the old Page URL.

Smashing :slight_smile:

Seems like an awful lot of blueprint code just for an image slider … :slight_smile:

If it was me I would put a featured project toggle field on all the project pages, and use a loop in a snippet/template to fetch them all, rather then have all that yaml.

<?php foreach ($site->find('projects')->children()->filterBy('featured', true) as $projects): ?>
 ...
<?php endforeach ?>

Another way is to use the images plugin & file meta data to set your title, makes stuff like this a doddle.

Or, you can use a structure field with a select and an image field, if need be with a limit.