开发者

embed header and footer in all html page using google sitebricks @embed

I am building an Admin dashboard with google guice and sitebricks .Can you please tell me how to include other html files in a html page ? I am looking for a function similar to php's include("header.html") function . I see that sitebricks has an @embed annotation but couldnt find much help about it

Thanks开发者_运维技巧 in advance


You have different possibilities.

Use embed

The @Embed annotation allows you to declare pages fragment that can be embed into other pages.

You'll find a full example here : http://code.google.com/p/google-sitebricks/wiki/EmbeddingBricks

Use decoration

The other approach is to decalre a generic page with your header and footer and use the @Decorated annotation on the container div of your page.

Then you have to declare all pages as @Decorated and extends the generic page.

Please find more documentation in sitebricks google group : https://groups.google.com/forum/#!searchin/google-sitebricks/decorated/google-sitebricks/CUOJM-CP9hM/ENe930RAuZwJ


Please check the examples at site-bricks site and let us know if they help. http://code.google.com/p/google-sitebricks/source/browse/trunk/acceptance-test/src/main/java/com/google/sitebricks/example/?r=146

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜