This project is read-only.

ShapeFactory and passing shape name by string variable

Topics: Customizing Orchard, Writing modules
Jan 22, 2013 at 11:17 AM
Edited Jan 22, 2013 at 11: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.

Jan 22, 2013 at 5:30 PM

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

See IShapeFactory/DefaultShapeFactory for details.

Jan 22, 2013 at 6:00 PM


Thank you sebastien.