Tapestry5 Layout sources |
The first thing we have to do is add the tuktuk assets like the style sheets and scripts.
1. Copy the style sheets into the layout folder. You should be adding 3 stylesheets: tuktuk.css, tuktuk.icons.css and tuktuk.theme.css
2. If the folder doesn't exist yet, create a "js" folder in the layout folder and copy the tuktuk.js file into it.
With the assets in place, we need to tell Tapestry5 about it. Open up the layout.java source file in the components folder. And right on top of the class declaration is an @import annotation, this what we change so our Tapestry webapp will be using the tuktuk assets. Change it to:
@Import( stylesheet = {"context:layout/tuktuk.css","context:layout/tuktuk.icons.css", "context:layout/tuktuk.theme.css","context:layout/layout.css"}, library = {"context:layout/js/tuktuk.js"})
That layout.css stylesheet is your own stylesheet seperate from the tuktuk.css. It's a bad idea to add your own style rules to the tuktuk.css. It's better to use your own.
The last step is to edit the layout.tml. The layout.tml is a very simple HTML template file so it should fairly easy to understand. It's a HTML file for christ sakes!
No comments:
Post a Comment