Renamed folder keeps reappearing

Hello,

in a current Kirby project (running on 2.5.7), I initially set up a folder structure like this:

content/
  1-collection
    1-product-a
    2-product-b
    (…)
  2-about

A few days back, I renamed “collection” to “shop”:

content/
  1-shop
    1-product-a
    2-product-b
    (…)
  2-about

everything went as expected. However, whenever I edit an existing “product”, the “collection” folder keeps reappearing, so my structure looks like this:

content/
  1-collection
    1-product-a
  1-shop
    1-product-a
    2-product-b
    (…)
  2-about

I am pretty sure I am missing something very obvious here, but just can’t wrap my head around it …

Did you simply rename folder directly in the filesystem? I suspect you neglected to also update the corresponding blueprints and templates.

If you look under the title field, it will show the page url (which im guessing still says collection on your existing articles). Try clicking the wand and it should fix the path.

The blueprints and templates are independent of the name of the folder, only text file name and template/blueprint name must be the same.

If you change stuff directly in the filesystem (instead of via the Panel), it is advisable to log out of the Panel and then log in again to make sure there are no leftovers in the session.

Sure, but if the templates are still wrong, it will make a text file with the old name, causing the folder to come back wouldn’t it?

Yes, I renamed the folder directly in the file system. I’ve double- and tripple checked all blueprints and templates, and made sure the text file name and the template/blueprint name are identical (shop.txt, shop.php, shop.yaml).

No, if you rename a folder, you don’t even have to change the template etc or rename the text file. And a text file with the wrong name does not misteriously create a new page. Also, you can have as many templates or blueprints without a corresponding page.

Is there maybe a page builder in your site.yml? I can’t think of an explanation that would make sense, unless there are some ghosts doing their job.

No, no page builder in my site.yml

Strange enough, this problem occurs only if I change an entry that uses a Structure field. To explain, I have a “simple” product (product.txt / .php / .yml) and a “product with options” (productoptions.txt / .php / .yml) template. The latter uses a Structure field; and only if I make changes in a productoptions.txt file via the panel, the folder mysteriously reappears.

Could you please post the productoptions.yml blueprint? And the shop.yml as well.

Interesting. When i first learnt Kirby a couple of years ago, I understood from the docs that for a page to work, you needed a blueprint and a corresponding template, and when you create a page it names the text file after the template chosen for the page. If you delete a template and a page in the site is still using it, it will revert to the default template.

Sure:

title: Product with options

pages: false
  template:
    - productoptions
    - product

files:
  sortable: true
  fields:
    caption:
      label: Caption
      type: text

fields:
  name:
    label: Name
    type:  text

  Identifier:
    label: Identifier
    type:  text
    width: 1/4

  Price:
    label: Price (Overview)
    type:  number
    width: 1/4

  Available:
    label: Product is available
    type: toggle
    default: yes
    width: 1/4

  Featured:
    label: Featured Product
    type: toggle
    default: no
    width: 1/4

  Featuredtext:
    label: Product Feature Text
    type:  text

  Productoptions:
    label: Options
    type: structure
    style: table
    modalsize: small
    fields:
      material:
        label: Material / Color
        type: text
      size:
        label: Size
        type: text
      price:
        label: Price in €
        type: number
        required: true

  Description:
    label: Description
    type:  textarea

  tags:
    label: Tags
    type: tags

@jimbobrjames Yes, that is all correct, but that doesn’t contradict what I was saying.

@anteante That blueprint doesn’t make sense. You are disallowing pages but have a limited template option. The templates to use should be defined in the parent template, i.e. the shop.yml.

shop.yml

title: Shop

pages:
  template:
    - productoptions
    - product

productoptions.yml

pages: false

@texnixe nevermind, im struggling to explain my point and we are getting off @anteante problem.

Of course, you are right. I had this

pages: true
  template:
    - product
    - productoptions

in my shop.yml already.

I now deleted this part

  template:
    - product
    - productoptions

from my productoptions.yml as it really does not make sense there. However, the problem persists. When I make a change in a productoptions.txt file, the “collections” repears.

I bet there’s something in your computer :bug: :ghost: playing funny games with you :joy:

If you want, you can provide a zip download link with your project and I’ll take a look (sonja@getkirby.com)

Lol… try logging out of the panel and in again.

@texnixe I guess you must be right … spookey :ghost: it must me something on my computer, maybe a git issue! I just transferred the whole project to a remote server (instead of localhost) and it seems to work fine :blush:

Sorry for taking up your time, and thanks (again!) for the swift support!

I have definitely had :ghost::ghost::ghost: folders resurrect themselves after renaming on some of my projects and it was down to incorrect naming conventions in the blueprint/templates. Maybe it was session data doing it, I don’t know how else to explain it.

Also i wish the emoji picker on the forum worked in Opera :frowning:

Git doesn’t usually resurrect pages unless you undo something. I’d rather think it was a session issue.

I’d clear the browser cache, log out and in and maybe even replace the Kirby and panel folders with fresh copies. Or copy everything into a new project folder on localhost.

Sometimes, you just don’t know why things happen, like socks disappearing…:socks:

Kirby is very cool, but can it find my missing :socks:?