How to create alternate template

Topics: Customizing Orchard
May 2, 2013 at 11:36 AM
Hello,

In my Migration code, I have an Address Part with some Text Fields:
  ContentDefinitionManager.AlterPartDefinition("AddressPart", part => part
               .Attachable(false)
                .WithField("Address Line 1", f => f.OfType("TextField"))
                .WithField("Address Line 2", f => f.OfType("TextField"))
                .WithField("Zip Code", f => f.OfType("TextField"))
                .WithField("City", f => f.OfType("TextField"))
               );
Admin can add more fields to this Part using the admin UI.
This part is then displayed in the front-end UI using the built-in template of the Text Fields.

Now, how can I create an alternate template for this Part?
Say for example, I want the html to look like this:
<div>
(Html for Address Line 1)
(Html for Address Line 2)
<div>
<div>
(Html for Zip Code)
(Html for City)
<div>
(Html for any Additional Fields)


Right now, using the built-in template, it basically looks like this:
(Html for Address Line 1)
(Html for Address Line 2)
(Html for Zip Code)
(Html for City)
(Html for any Additional Fields)

Please help,
Thanks.
Coordinator
May 4, 2013 at 3:53 AM