Let plugin create pages


I would like to create a plugin. Now I think the following would be a good way to go.

The plugin must create multiple pages when creating a new page. These standard and always the same extra pages are sub pages of the created page. (see sub pages of India)

├── continents
|   └── Europe
|   └── South America
|   │   └── Peru
|   │   └── Chilie
|   ├── Asia
|   │   └── India
|   |        └── When to go
|   |        └── Weather
|   |        └── Visa

Now I’ve been going through the documentation for a while to see how I could make this. However, I can’t find anywhere how I could create 1 or more pages with a plugin.

How could I do this ? Or are there better ways to handle this?

hello @wouter,
you can create cms pages with the CMS (editor link in the backend) or using static pages using the plugin called pages
the later plugin allows you as well to create menu

Hello @chris,

Thanks for your response, maybe I wasn’t clear in my question. I hope this clarifies it a bit.

I know that I can create a page with cms pages. What I want to create is that if I create a page of a country that an x ​​number of sub pages are automatically created. so every country have the same pages.

So my qeustions are:

  • Can i use cms pages to automatic generate some subpages ?
  • Today i read about Tailor, maybe is that a option ?

ok thanks for clarifying. I can see many ways to achieve that. Depending on whether or not you are using a plugin and a component.

you could have all your subpages pre-pready (since it looks like there are fixed) in the CMS.
Their URL would be :country/yoursubpagename
for instance, for the subpage about it would be /:country/about
for instance, for the subpage areas it would be /:country/areas

you would add your component in these pages, which would fetch the data of the country based on the parameter :country