Layouts vs Pages

Hello everyone, I am having some issues understanding the layouts and the pages.

I have a page (index) and a "main" layout. In my index page I have the "main" layout (don't know if this is well done)!

When I try to preview the index page it shows me the "main" layout, I don't know why.

I'll leave some images bellow:


Thanks,
Rodrigo

Hi Rodrigo,

That is the way it is suppose to work. All content pages that have 'main' as the assigned layout page will use the main layout. You can create more layout pages if you need.

What result were you expecting? Maybe that will help us understand where you are having problems.

A layout page is like a skeleton that holds the general structure of your website (header, footer, styles, etc.). Instead of repeating this structure in every page, you define it once and insert dynamic content inside it.

A content page contains only the specific content of a webpage (e.g., home, about, contact). It does not include the full structure because it will be inserted inside the layout.

When previewing your content page in a browser you see the whole structure - i.e. the layout page and the specific content page inside rendered.

Note that on the layout page you should never remove the view component:

as it is needed. If you want to add header/footer you should add them before or after the view component.

You can also have different layout pages to base your content pages on. Some may include different common elements than others, depending on your needs.

1 Like

Hello Brad, thanks for the response! Teodor understood what I was asking!

1 Like

Thanks Teodor, it works! Thanks a lot!

1 Like