This project is read-only.

Feature Request

Sep 16, 2011 at 4:38 PM

It would be great to extend the Html.Partial method to be widgetzone aware. for example it would be nice in an .cshtml to be able to render a partial view into an DNA WidgetZone


@Html.Partial("mywidget").ToZone("topzone") and behave the same as it would if it was added to the page using the page builder

Sep 16, 2011 at 4:46 PM

That will make widget dead. Widget is not only a View. 

Please read this

Sep 16, 2011 at 4:52 PM

it would not make it dead, it would complement it. where is an example

I am developing a store for DNA, and the checkout / product etc... would be called from DNA widgets that can be added to anypage however since for example product is not part of the sitemap nor pagemanager I have no way to add default widgets to the page like the catagory or mini shopping cart etc....

I could however if the HTML.Partial was extended to support WidgetZones I could invoke those default widgets into the layout provided that the widgets are registered in DNA

Sep 16, 2011 at 5:18 PM

Oh, i am understand now. You can use the SiteMapActionAttribute.Template property to specified a page template to add the default widgets.

The Template property is a web page xml template file url

How to get this file?

1.Create a page and add widgets what you want.

2.Go go pageManager and select the page then click "Export" 

3.Copy this xml file to your dna installation path e.g. ~/content/webpage_templates/_common_page.xml

4.Set the url reference by using Template property

public ActionResult YourAction()
    return View();

Unfortunately the Tempalte feature is disabled in this release version.But you can open the "DNA.MVC.UI/SiteMapActionAttribute.cs" cancel the comment on line 152 ~ 166 to enable it.