This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

keevitaja8117
keevitaja8117

Hello,

Is is possible to extend a layout? Laravel blade has this feature...

Like i have layout main.htm , which will be extend by a products.htm layoyt , which will be used by a page. Page has no knowledge that main.htm exists.

Crazymodder
Crazymodder

Hi,

What do you want to do with that? I think there is no equivalent function in october. But I think you can manage it in another way. But to try to help I need more infos.

Regards Crazymodder

codaha12007
codaha12007

I also thinked about something similar (not sure if exactly same as keevitaja8117 idea though).

Main template would only contain basic scaffolding which would be same or all layouts, like , and tags.

It could be extended to add document structure into body and client would only enter data trough various placeholders using static page plugin.

Now i can do this using two partial first for section and second for closing and which is little counter intuitive.

Last updated

codaha12007
codaha12007

Crazymodder said:

Hi,

What do you want to do with that?

Let me add something. Lets assume that have few different layouts but with repeatable content like metatags, of course i dont want to edit all these layouts if i need to change something in metatags.

Now i can just use partial and include it to all these layouts. But i cant use placeholder inside this partial.

Its shame that october devs dropped twig native extends function.

Last updated

Crazymodder
Crazymodder

Hi coadaha12007,

I can't see there a problem. You can make a partial include it multiple times as a "placeholder". Or you make a partial with many snippets and than you can edit each snippet. You can set options at the snippet so that your customer only need to populate the options you prepare. I really want to help but at the moment I didn't catch the problem. Maybe you can make a screenshot what you plan to do.

Regards Crazymodder

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.