Adding widgets setting page layout at runtime

Sep 8, 2011 at 2:31 PM

From a view is there a way to call a DNA page template and load widgets during runtime. the project I am working on will have pages that is not managed by the dynamicpage controller but does use ~/views/shared/_layout as it's view and it does render exactly what I want, except it is only a single column page and not widgets, also being that it is called from a controller and not from the pagemanager, there is no  way I can add widgets

Coordinator
Sep 8, 2011 at 6:30 PM

Read this article http://www.dotnetage.com/publishing/dna/2011/08/31/6909/extending-action-as-webpage.html it maybe helpful for you.

Sep 10, 2011 at 4:44 PM

what I am more interested in is from a cshtml view, I can define a widget add to a zone that is defined in my layout

@{

Ajax.DNA().Widget("FeaturedProduct",

.Content(<text>

@Html.RenderPartial("/Areas/Store/Views/Shared/FeaturedProducts.ascx")

</text>)

.Render()

.AddToZone("zone0") //This would be a great helper method

);

}

//This is where I will add my body elements

Coordinator
Sep 10, 2011 at 4:50 PM

Oh,you going in a wrong way! Please read the following article first

  • http://www.dotnetage.com/publishing/dna/2011/08/31/6907/introduction-to-widgetengine.html 
  • http://www.dotnetage.com/publishing/dna/2011/08/31/6886/adding-and-managing-widgets.html
  • http://www.dotnetage.com/publishing/dna/2011/08/31/6891/adding-widgets-to-web-page.html
  • http://www.dotnetage.com/publishing/dna/2011/08/31/6908/create-action-base-widgets.html