I am somewhat new to TWIG and I am not sure if this will work with Grav.
What I want is to change the Page Editor for Content to not only have a title and Content but to have 4 content forms and for each an image.
This I need only for my home.html.twig layout because on the homepage I will have four parts of the site which will have little content with each an image.
Can I create a new page for each part (like home1, home2, home3 and home4) and then show each on the correct homepage? How would this work with Grav/Twig?
Or are there more simple solutions like a Twig for the Page Editor Content to show 4 forms and 4 Media selections?
This is called a modular page and the theme you are using needs a template to do this.
You can find all the information you need to create this here: Grav learn: Modular pages
You also have many skeletons just for this. It is a good idea to learn from this to get a faster learning curve.
When you create a modular page you are not really creating child pages, rather modules that is put into order with a page collection.
If I understand you correctly then the easiest way is to create “Home” as a modular page and add each section as a module under “Home”.
This way you can style each section as you like by adding new templates in the modular folder in your-theme/templates/modular.
True, so I keep the structure in the Front-End and work with page childs on back-end.
One last question here: would it be possible to do the nesting of section 1 with modular page and the sections 1, 2 and 3 with page childs? This would mean I would change the modular.html.twig… maybe not so good idea…?
I have tried nesting the blocks(modules) in section 1 in a folder and within section 1, but failed.
When working with modular pages you are not really working with child pages, rather modules or blocks of a page. You could add more collections to modular.html.twig for displaying content that you organized in the admin, but if the page is not that complicated it would just be more work then value since the result would be the same anyways.
I guess you want to have something like “read more”? Then I would just add a new non-moldular page that is routable, but not visible to display that content if you want the site to be kept simple.
I see advantages separating these into blocks inside a module.
But if you take a look at the possibilities with markdown editing then you see that everything you ask for can be done there.
In the section 1 content your blocks can easily be added by for example adding:
___ (three underscores)
Image | Text
To get a block inside this content.
Or if you need to style it a bit more then make a template for each block and add each of the block as a module under section one.
This will require some knowledge of html and css. To make it simple you can copy the twig code from templates like landio which includes many different possibilities such as video, testimonials, text and so on as modular templates.
If that is the case then enable markdown extra in system configuration. Then you can add almost any HTML you want:)
To succeed always think simple first. Everything else comes afterwards.
I basically want to do the same and think i should be possible with a custom template .twig file similar to the text.html.twig contained in the antimatter theme.