grails' sitemesh text/html,sitemesh - Grails Nested Layouts - Stack Overflow

I am new to Grails/GSP/Sitemesh and am trying to figure out if I can use nested layouts. I would like to have a main layout that will be used for all of my pages to contain a standard header, footer, and all my CSS/JavaScript resources. On another subset of pages I would like to define a layout that will inherit from the main one and add a side menu and a few other things. That way each of my pages for that section references the second layout and automatically gets the content from it along with the main layout.

Is this possible to do? How do I define the second layout to reference the main one to make this work?

Update 1

So, I read through the blog article linked to in a comment below and am still having trouble. I tried setting up a very simple test case with the following hierarchy.

/layouts/main.gsp

-- /layouts/sub.gsp

-- /test/index.gsp

For my pages I have the following... in main.gsp:

MAIN

in sub.gsp:

Sub

and finally in index.gsp:

Title Here

Content

When I load my page the page title is set correctly, and I see "Main" and "Sub" rendered on the page, but "Content" is not shown. I'm sure I must be doing something simple wrong... any ideas?

Update 2

I figured out that I had and it should have just been . Seems to be working now.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值