Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • firepol 125 posts 173 karma points
    Nov 22, 2013 @ 16:28
    firepol
    2

    Create a Section in the new Umbraco 7

    Hi,

    now that umbraco 7 is out, my first question is, where do I find the updated documentation for the umbraco 7 API, and specifically to extend the backend of umbraco 7? I don't see anything new here: http://our.umbraco.org/documentation/reference/

    In particular, how to create a new section in umbraco 7? Best practices, what can be re-used, what has to be manually coded?

    For an old umbraco project, to create a section, I had to do as explained in this guide. Then:

    create some pages for my section and place them inside umbraco/plugins (wonder if this is a good practice, probably not but for what I remember I had to do like this, don't remember why)

    if I wanted to use the umbraco document types and have nice c# classes for them, had to use linq2umbraco (not supported anymore) and I also asked in another thread what to use as alternative to linq2umbraco, without a satisfying answer (I know there is uSync, uCodeGen but in the end what is recommended to use, with linq2umbraco with a couple of clicks I could generate all the c# classes I needed, for what I've seen there is no package able to do the same thing, so I also wonder why the support to linq2umbraco was dropped, it was such a cool thing... much better than using the getProperty("manualname").value ...)

    if I wanted to use the umbraco backend UI to create/edit new nodes, I had to create, in my section page/usercontrol a button like this:

    <input type="button" onclick="openCreateDialog()" value="Create new Event" />

    function openCreateDialog() {

        UmbClientMgr.openModalWindow("create.aspx?nodeId=" + "1349" + "&nodeType=" + "content" + "&nodeName=" + "Events" + '&rnd=' + Umbraco.Utils.generateRandom(), "Create", true, 600, 425);

    }

    I don't know if you see what I'm doing here, I'm trying to save some coding time by trying to use what umbraco offers... especially if a document type has some special data types from uComponents like multi picker, media picker etc. I think it's reasonable to use the umbraco create dialog instead of coding something new myself... reinventing the wheel, right?

    I've seen in the umbraco 7 introductory video that it's possible, for folders containing lot of nodes, to use a ListView. It would be cool to know if it's possible to extend the list view by adding/removing columns, e.g. Creator Username, Checkbox "published / unpublished", last edit date etc. and it would be cool also to extend the search for the ListView. Now it's possible to search only the node name... it would be cool to allow the developer to code some criterias, e.g. search by filtering creation date, by filtering last edit date, etc.

    I'm asking this, because I had to create a section for a customer which does exactly those things. You can't imagine how much it is a pain to maintain this section, created with linq2umbraco with a document provider letting me also find the unpublished nodes (a sort of hack). After 2 years (upgrading the website from umbraco 4.7 to 6.1.x -btw that was also quite an adventure-) I could see that the hack didn't scale as the documents increased... and with more than 200 nodes of a specific type, it's damn slow, something like 2-3 minutes to get a list of all document of a specific types (for a total of 700 documents).

    I really hope that somebody of the core team reads this and thinks about some tutorial, guide or maybe to implement some sort of customization for umbraco 7.x (maybe in the next version? ;) ) so that it would be easier to create a simple backend section like this.

    Oh last but not least, thanks for the great umbraco 7 and looking forward to resources (docu) to learn more about how to use it as developer.

    Cheers

  • Nigel Wilson 945 posts 2077 karma points
    Apr 15, 2014 @ 07:22
    Nigel Wilson
    0

    Hi Firepol

    http://www.enkelmedia.se/blogg/2013/11/22/creating-custom-sections-in-umbraco-7-part-1.aspx details how to make a custom section, but try as I might I can't get it to work.

    I have been coding the custom section in a separate class within my solution and having the DLL copy into my website project, however there are conflicts.

    Is anyone able to provide some sample code for a wireframe custom section that is contained within a separate project ?

    I was wanting to upgrade the Tag Manager Package but am completely stumped.

    Cheers

    Nigel

     

  • Shaun 248 posts 475 karma points
    Apr 15, 2014 @ 13:04
    Shaun
    0

    I'm in a similar boat. I've followed the link Nigel used and have the section up and running, but I'm having to generate my own tree in the backend, and can't seem to get any of the angular stuff to work at all.

    Documentation would be marvellous. There are a few links out there, but none of them seem to use the same methodology and it's a bit of a maze.

  • Nigel Wilson 945 posts 2077 karma points
    Apr 15, 2014 @ 22:01
    Nigel Wilson
    0

    hi Shaun

    Seems like you are one step further ahead than me :-)  I haven't gotten to the angular part yet !!!

    Did you create a separate project for your custom tree classes or simply include in the website project ?

    If separate would there be any chance of sharing your code - I'd be hugely grateful and it would enable me to get the intiial bit out of the way to then be able to look at the angular code...

    Cheers

    Nigel - info 'at' yoyocms 'dot' co 'dot'nz

  • Shaun 248 posts 475 karma points
    Apr 16, 2014 @ 10:07
    Shaun
    0

    Hi Nigel

    I tend to pop it all in a single project, easier to port it around that way. I'll drop you a mail.

  • Shaun 248 posts 475 karma points
    Apr 16, 2014 @ 11:00
    Shaun
    0

    Right, apologies for thread hijacking, but I'm not sure where else to put this.

    I'm redoing my custom section, as, with the best will in the world, I just cannot get my head around why we are writing classes for stuff that can just be tweaked in an xml file. I'm using 7.03.

    Step 1. Edit config/applications.config. Add my new section

    <add alias="customsection" name="Custom Section" icon="icon-file-cabinet" sortOrder="5" />

    step 2. edit the umbraco/config/lang/en.xml file to prettify the title in the backend.

    <key alias="custimsection">Custom Section</key>

    So now I have my custom section. 

    Next step is to work on the tree. my tree has some fiddly requirements. It's going to be generated from stuff stored in a separate table in the database. I have tried using the new method described here

    http://www.enkelmedia.se/blogg/2013/11/22/creating-custom-sections-in-umbraco-7-part-1.aspx 

    however that does not give me the option to specify the actual filenames used to handle actions, e.g. create. delete etc. Instead I'm limited to the routes umbraco wishes to take, all of which end in an angular js file. I don't want to use angular js as I can't get it to work, so I'm going to try building the tree using an older method that I saw people using with v6 of umbraco.

  • Shaun 248 posts 475 karma points
    Apr 16, 2014 @ 11:02
    Shaun
    0

    oops.

    <keyalias="custimsection">Custom Section</key>

    should read

    <keyalias="customsection">Custom Section</key>
  • Shaun 248 posts 475 karma points
    Apr 16, 2014 @ 11:36
    Shaun
    0

    Well my old method didn't work. I could generate a tree by reading from the db, but I couldn't generate a root folder to put my elements in (what IS it with root folders in V7?) and I noticed that my tree nodes were still trying to point to angular.js files. 

    Thankfully I then discovered this.

    http://our.umbraco.org/forum/developers/extending-umbraco/46514-Can-you-use-NET-MVC-in-Umbraco-7-Backoffice

    So lets see where that gets us.

  • Shaun 248 posts 475 karma points
    Apr 16, 2014 @ 14:43
    Shaun
    0

    Yeah. That gets us nowhere.

    Why oh why is there not a central point of documentation for this stuff?!

     

  • Jordy van Eijk 7 posts 51 karma points
    Aug 05, 2014 @ 21:07
    Jordy van Eijk
    0

    Hi Nigel,

    Is it also possible to send me a working copy of the Custom section you'd created.

    You can send it at info 'at' vaneijk-development 'dot' nl

    I would much appreciate it.

  • firepol 125 posts 173 karma points
    Aug 06, 2014 @ 13:41
    firepol
    0

    It would be cool to have somebody from the umbraco development team to point some blog posts or documentation or umbraco TV step by step tutorial related to this question.

    So far I had no time to play with umbraco 7 because at work we need to support IE8, IE9 browsers, so we just use umbraco 6.x :(

    Also if somebody can publish something please share it. Not only private email, but maybe create a repository on github, or publish a zip somewhere, so we can all have a look at it. Thanks

  • Jordy van Eijk 7 posts 51 karma points
    Aug 13, 2014 @ 23:19
    Jordy van Eijk
    0

    Hi Nigel, It's a bit late but thank you for the email you sent me. I have to say that i'm still confused on how it is working because i still cant figure out how to do it. I was creating my section in a seperate project but it gave to much problems with the post build steps that it won't work.

    So now i decided to put it all in the App_Plugin folder of the main project but still figuring out how to do the angular stuff with the views

  • adrian 8 posts 39 karma points
    Apr 29, 2015 @ 10:36
    adrian
    0

    Remember about adding permission to new created section for user account

    https://stackoverflow.com/questions/26962307/umbraco-7-add-new-item-to-dashboard/26990248#26990248

Please Sign in or register to post replies

Write your reply to:

Draft