Tile configuration guide

R.Z. Slijp, 2008

This guide should help you configuring your tiles illustrated by sample scenario's. All paths in the samples are based on embedded tiles and thus refer to resouces inside the assembly. This example apply to a tile definition for a complete page and for a component.


A simple page

Name base
Features Just a simple page
WebForm equivalent .aspx with code behind. No master page
When To define a page or component

<tile
  name="Default.Page.Layout1"
  path="Views.Shared.Layout.tile2"
/>

  1. The name of the view
  2. The path the tile(layout)

Default.Page.Layout=
Contents of definition Views.Shared.Layout.tile

A page with tiles

with auto-properties
Name composit
Features A page with some tiles
WebForm equivalent .aspx with code behind. No master page
When To define a page or component which is composed of other tiles

<tile
  name="Default.Page.Layout1"
  path="Views.Shared.Layout.tile2"
>
    <attribute name="body3" value="Body.Home.Index4"/>
</tile>

  1. The name of the view
  2. The path the tile
  3. The name of the tile attribute. Use this handle to insert the tile.
  4. The name of a tile definition, path to a tile or static string representing the nested tile. Without stating the specific type of the attribute SharpTiles tries to resolve it automaticly in the following order:

    File - file tile can be the file system or embedded in the assembly
    Definition - definition tile
    String - static string tile

    See the next example for properties with the type declared

Default.Page.Layout=
Contents of definition Views.Shared.Layout.tile
Contents of definition Body.Home.Index

A page with tiles

without auto-properties
Name composit
Features A page with some tiles
WebForm equivalent .aspx with code behind. No master page
When To define a page or component which is composed of other tiles

<tile
  name="Default.Page.Layout1"
>
    <attribute name="header3"
      type="String4"
      value="Hello world5"
    />
    <attribute name="body"
      type="File6"
      value="c:\path\to\some\tile.html7"
    />
    <attribute name="footer"
      type="Definition8"
      value="Body.Home.Index9"
    />
</tile>

  1. The name of the view
  2. The path the tile
  3. The name of the tile attribute. Use this handle to insert the tile.
  4. Declare this attribute as a static string.
  5. The static string representing tile.
  6. Declare this attribute as a file tile.
  7. The path to the tile.
  8. Declare this attribute as a definition.
  9. The name of the tile definition.

Default.Page.Layout=
Contents of definition Views.Shared.Layout.tile
Hello world
Contents of file c:\path\to\some\tile.html
Contents of definition Body.Home.Index

Page extending a base tile

The "Default.Page.Layout" is defined in the "A page with tiles" example.
Name extends/inheritance
Features A tile inherting behaviour from an other tile
WebForm equivalent Some simple cases can be compared with the Master page concept. For nested inhertance or inheritance of components there is no WebForm equivalent.
When To ensure a default layout a base tile can be used. This exmaple shows how to make a concrete tile with use of a default layout

<tile name="About.Index1" extends="Default.Page.Layout2">
  <attribute name="specific" value="Views.About.Index.tile"/>
</tile>

  1. The name of the view
  2. The definition from which the behaviour(layout, attributes and inheritance) is extended.

Default.Page.Layout=
Contents of definition Views.Shared.Layout.tile
Hello world
Contents of file c:\path\to\some\tile.html
Contents of definition Body.Home.Index
Contents of definition Views.About.Index.tile
is extended from
Contents of definition Views.Shared.Layout.tile
Hello world
Contents of file c:\path\to\some\tile.html
Contents of definition Body.Home.Index

Page extending a base tile with an overriden attributes

The "Default.Page.Layout" is defined in the "A page with tiles" example.
Name extends/inheritance
Features A tile inherting behaviour from an other tile
WebForm equivalent Some simple cases can be compared with the Master page concept. For nested inhertance or inheritance of components there is no WebForm equivalent.
When To ensure a default layout a base tile can be used. This exmaple shows how to make a concrete tile with use of a default layout

<tile name="About.Index1" extends="Default.Page.Layout2">
  <attribute name="title3" type="String" value="About page"/>
  <attribute name="body4" value="Views.About.Index.tile"/>
</tile>

  1. The name of the view
  2. The definition from which the behaviour(layout, attributes and inheritance) is extended.
  3. A new attribute
  4. The body attribute of the Default.Page.Layout is overriden

Default.Page.Layout=
Contents of definition Views.Shared.Layout.tile
About page
Contents of definition Views.About.Index.tile
Contents of definition Body.Home.Index
is extended from
Contents of definition Views.Shared.Layout.tile
Hello world
Contents of file c:\path\to\some\tile.html
Contents of definition Body.Home.Index

Page extending a base tile with use of new templates

The "Default.Page.Layout" is defined in the "A page with tiles" example.
Name extends/inheritance with a new tile
Features A tile inheriting behaviour from an other tile except that the template is redefined.
WebForm equivalent none
When This is best illustrated with an example. Think of a application with an administrator and a participant portal. The layout of both portals are different. Some pages can be used directly form one portal into the other portal. Overriding the layout tile helps you to render both the pages on both portals correctly with as much reuse as possible.

<tile name="Default.Participant.PortalPage.Layout1"
  extends="Default.Page.Layout2"
  path="Views.Participant.Portal.Layout.tile3"
>
  <attribute name="title4" type="String" value="Participant portal"/>
</tile>

  1. The name of the view
  2. The definition from which the behaviour(attributes and inheritance) is extended.
  3. The path the tile(new layout)
  4. A new attribute

Default.Page.Layout=
Contents of definition Views.Participant.Portal.Layout.tile
Participant portal
Contents of file c:\path\to\some\tile.html
Contents of definition Body.Home.Index
is extended from
Contents of definition Views.Shared.Layout.tile
Hello world
Contents of file c:\path\to\some\tile.html
Contents of definition Body.Home.Index

Contact form fixed

I regret reporting that the contact form was broken for the last week. All mails send to us were corrupted(empty). So reported bugs in the last week are not received. I'm aware that the timing with regards to the monorail release isn't very handy. The contact form is fixed now. I apologize.

4 February, 2010

Monorail released M5

Monorail is released. The release also contains some minor fixes.

23 January, 2010

Monorail almost finished

Maikel Willemse is coding a Monorail view engine. It's available in the nightly release. A tutorial and a new release will be available shortly.

2 January, 2010

No more tiles.xml
(if you like)

A NSTL view engine is now available. You can do SharpTiles without having a tiles.xml. You will lose the power of dependency injection. If you are interested check out the tutorial page.

21 July, 2009

Developer M3 released

Fixed a couple of parse bugs. Cleaned up refreshing of resources, resource locations and registration of the TilesViewEngine. Wrote some tutorials
Ronald Dehuysser contributed the <tiles:insertTemplate/> and <tiles:putAttribute/> tag.

8 June, 2009

HtmlHelper wrapped II

Updated tag reference documentation.

5 April, 2009

Ready for MVC RC 2

SharpTiles is now ready to use with MVC RC 2.

6 March, 2009

HtmlHelper wrapped

The MVC HtmlHelper is now wrapped and can be used. For it's only available in the nightly build. When the documentation and new Tutorials are made a new release will be made.

22 December, 2008

Ready for Beta 1

SharpTiles is now ready to use with MVC Beta 1. The tutorial page will be updated soon.

3 November, 2008

We've got Tiles

It took me a bit longer than expected but Milestone 1 is reached. Tiles are now available.

23 July, 2008

First release

Finally, after some hard work my pet project is ready for its initial release. Here it is! Please give it some thoughts and feel free to add comments.

23 May, 2008

SID: PopUp 0