Copied to clipboard

Flag this post as spam?

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


  • Peter Nielsen 159 posts 257 karma points
    Feb 16, 2011 @ 22:41
    Peter Nielsen
    0

    Allow only a certent number of childnodes to a doctype

    Hi,

    I just thought of an idea that could make my day as a developer a little easier, so i wanted to share it with you as an idea to a future project.

    As you have the ability to decide which child nodetypes ones doctype can have, you should have the ability to decide how many times a certent doctype can be used as a childnode.

    I think that could be a good function to add.. what do you think? :-)

    Regards

    Peter

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 16, 2011 @ 23:46
    Jan Skovgaard
    0

    Hi pedn

    Could you try to give some examples on where this would make your life more easy? I'm having a hard time figuring out why you would want to limit the creation of child nodes?

    If such a situation is present I think it's a matter of making a limit to how many childnodes are being displayed in for instance a news-list on the frontpage on a site. Set a limit and then make sure to sort the nodes so the new ones push the old ones away once new content has been created.

    Would'nt that be enough? Or am I missing your point completely? :-)

    Would be cool if you made an example of why you think it would be nice and how it could improve your working process.

    /Jan

  • Peter Nielsen 159 posts 257 karma points
    Feb 17, 2011 @ 08:54
    Peter Nielsen
    0

    Hi Jan,

     

    I was about to give an example when my girlfriend was heading to bed and i had to wrap it up :)

    An example could be that right now im working on a bandbooking site, and I want to make a seperate login for every band. Now I often use a page as a module/component to another page. Example: Every seperate bands frontpage should have the ability to have a tourcalendar. But what If i wanted the band to add it theirself, if they wanted it. It could be cool if they only could add it once then.

    Of course i could add it for them, and then use umbracoNaviHide or something to turn it on and off, but i think this way could be more useful :-)

    Just a thought :-)

    /Peter

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 17, 2011 @ 09:03
    Jan Skovgaard
    0

    Hi Peter

    Ah in that what...

    Well I guess it should be farily easy to hook into an event using some C# and check if a document type already exists and then either cancel the creation or maybe even remove the checkmark in the "strutucre" tab on the document type.

    You can see an overview of the different events here: http://our.umbraco.org/wiki/reference/api-cheatsheet/using-applicationbase-to-register-events/overview-of-all-events - With the right skills I think it's should be fairly easy to make sure certain document types are only created once.

    So I don't think it's something that should be a part of the core, but maybe it's a good idea for at package that could provide one with this option?

    Hope this helps :-)

    /Jan

  • Peter Nielsen 159 posts 257 karma points
    Feb 17, 2011 @ 09:08
    Peter Nielsen
    0

    Aarh.. Maybe you are right :-)

    I actually just bought a Umbraco TV membership a couple of days ago. Maybe i'll look into the events and learn how to do it when i got the time. For now this site just has to be done :-)

    /Peter

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 17, 2011 @ 09:10
    Jan Skovgaard
    0

    Hi Peter

    That's a good investment and I'm sure you'll benefit from it without a doubt. I think you'll easily be able to make the solution I'm suggesting above. But if any further questions come to mind please don't hesitate to let us know :-)

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft