ShapeFactory and passing shape name by string variable

Topics: Customizing Orchard, Writing modules
Jan 22, 2013 at 10:17 AM
Edited Jan 22, 2013 at 10:25 AM

Within my controller action I can do something like this to define the shape template :

dynamic shape = _shapeFactory.MyShapeTemplate();
shape.Property1=  "ffgg";
return new ShapePartialResult(this, shape);

Can i set the shape name somehow dynamically from a string variable, something like this :


string shapeName="MyShapeTemplate";
dynamic shape = _shapeFactory.SetShapeName(shapeName);

Thank you in advance.

Coordinator
Jan 22, 2013 at 4:30 PM

string shapeName="MyShapeTemplate";
dynamic shape = _shapeFactory.Create(shapeName);

See IShapeFactory/DefaultShapeFactory for details.

Jan 22, 2013 at 5:00 PM

Great.

Thank you sebastien.