Mar 23, 2013 at 7:07 PM
Edited Mar 23, 2013 at 7:08 PM
I am wanting to create some front-end pages to collect info from site visitors. Some of the inputs would include checkbox lists, drop downs or radio buttons. I've looked over the Creating Relations documentation, but this seems a little bit much for my
scenario of collecting low-level data.
I've read some discussions about creating taxonomies in migrations, and have looked at the implementation used in some modules (Pluralsight.Movies, for example). However, most everything seems to use Records/Parts and I was just thinking of low-level data collection
and only using Records.
Anyways, I'm just a bit confused about how I might programatically add it to my page, particularly since I am not using a part. All the examples I see use "ContentDefinitionManager.AlterPartDefinition" in the migration file.
Say I have a simple Record.cs file with FirstName, LastName (among others). Then I created a taxonomy of Interests (Hiking, Fishing, Bicycling, etc.) using migrations.
In my view for that I would do this:
@Html.TextBoxFor(m => m.FirstName)
@Html.TextBoxFor(m => m.LastName)
But how do I insert the checkboxes for Interests? I thought I could encapsulate it in a shape and then call
so that I can have some code inside to customize how I want it to look.
I know I can do something like this to create a shape in my controller:
public ShapeResult MyShape()
var shape = _orchardServices.New.MyShape();
return new ShapeResult(this, shape);
and then call something like this in my view (and have the corresponding .cshtml file):
Well, that's a lot to chew on I guess. But is there something out there I can read through to help me figure out the best way to use taxonomies to display checkbox lists, radio buttons or drop downs in the front end?