Copying subpages from a page into another page

Copying subpages from a top-level page into another top-level page

I’m trying to create a gallery with categories without the trouble of having to add new pages for every image and select it’s category. Instead the client can just click the category from the projects page and drop all the images into it and done.

I have a page for creating the Categories and then I have a separate page for the Projects. What I want to do is to (automatically) copy the categories into the projects page. For example, every time the user adds a new category it automatically adds a subpage into the projects page. Is there a way to do that or do you have a different solution for this? Projects and Categories are both top-level pages.

I know Kirby has the subpage builder but I don’t think that does what I’m looking for.

How are the categories added? As tags in a page field? Or as subpages of the categories page?

The categories are added as subpages

You could use panel hooks to create a new page in /projects whenever a new page is created in /categories. But this would result in duplicating pages, is there a reason for that? Why don’t you add the categories as subpages of the projects page in the first place?

I wanted to have them separated because the categories are actually the services which have more information about the service. I wanted to keep the information of the service separate from the projects just to not cause confusion and have a cleaner structure, but I think I’ll just do it like you suggested

It all depends on the internal content dependencies and the kind of content you have, but maybe you could also solve this by dynamically fetching the data from the categories when displaying projects. This solution would avoid duplicating the content.

But how would the projects be categorized? I want to be able to just drag and drop the images into it’s appropriate category. The way I’m currently doing it is by creating a new page for every project and selecting the category but the problem with this is that I have to add a title and it’s also a lot more work having to create a new page for every project and I can’t ‘mass upload’.

The current structure looks something like this:

Projects (Top-Level Page)
  - Project (I have to create a sub-page for every project)
      - Title
      - Images
      - Category
        - List of categories fetched from the services page

Services (Top-Level Page)
  - Service (Sub-Page for every service)
    - Title
    - Description
    - Featured
      - Yes / No
    - Icon
      - List of icons

And I want to simplify Projects to look like this:

Projects (Top-Level Page)
  - Categories (Sub-Page fetched from the services page )
    - Images - We can now just drop the images that belong in this category

I don’t know if this makes sense but that’s what I’m looking to do. If there’s no solution I’m going to do what @texnixe suggested and just combine the categories (services) and projects.

Couldn’t you put the images that belong to the service/category directly in the directory of the service instead of in a duplicate of it in the projects directory?

If the subpages in /projects have no other purpose than as containers for the images, it would indeed make more sense to put the images directly into the corresponding /categories subpages as @lukasbestle suggested or go with my previous suggestion of putting the categories into /projects and then add the images and all information about the service then and there. I would prefer either solution to duplicating content.