Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Ok, with some help I found the code to add a new application / section without modifying the config manually. Add an assmebly with this class in the /bin folder and the section is automatically added to Umbraco.

[Application("guestbook", "Guestbook", ".trayguestbook", 20)]
public class Class1 : IApplication
{

Then you can modify the Tree by adding a class that inherits from BaseTree.

[Tree("guestbook", "guestbookTree", "Guestbook")]
public class Class2 : BaseTree
{

Is there a way to modify the dashboard with a similair approach as well?

Thanks!

share|improve this question

1 Answer 1

As far as I know, there isn't a code first approach to modifying the dashboard.config. However, if you wrap your project into an Umbraco package, you can use package actions to add a dashboard section. Here's an example from the documentation:

<Action runat="install" alias="addDashboardSection" dashboardAlias="MyDashboardSection">
  <section>
    <areas>
      <area>default</area>
      <area>content</area>
    </areas>
    <tab caption="Last Edits">
      <control>/usercontrols/latestEdits.ascx</control>
      <control>/usercontrols/PostCreate.ascx</control>
    </tab>
    <tab caption="Create blog post">
      <control>/usercontrols/new.ascx</control>
    </tab>
  </section>
</Action>

For more details on package actions see Package Action Samples. For more information of creating Umbraco packages see How to create a project package for Umbraco?.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.