Hi guys,This might be a stupid question, but I would like to limit my users to only create a certain documenttype once.More specifically, I have a documenttype 'NewsArea', and viewing it doesn't make sense to have two news areas in one website, I would like to disable the creation of a second NewsArea to make it 'idiot-proof'.Any tips on how to make this happen?Kind regards,Manu
Should allow you to hook into the before_save or publish or where ever your logic needs.. (eg you might want the user to be able to create multiple.. but only have one published at a time as an alternative)
Only allow user to create a certain doctype once
Hi guys,This might be a stupid question, but I would like to limit my users to only create a certain documenttype once.More specifically, I have a documenttype 'NewsArea', and viewing it doesn't make sense to have two news areas in one website, I would like to disable the creation of a second NewsArea to make it 'idiot-proof'.Any tips on how to make this happen?Kind regards,Manu
Hi Manu,
See here:
http://our.umbraco.org/forum/templating/templates-and-document-types/19774-Limit-creation-of-document-types
This could be your solution
/Dennis
Hey Dennis,
Big thanks for your quick reply, highly appreciated.
Unfortunately, it's not exactly what I'm looking for. Although I do understand from this topic that my solution won't be available 'out-of-the-box'.
Therefore, my current thinking is that I would need to create some coding to follow below reasoning:
1) User creates doctype 'NewsArea'
2) Code checks if a doctype with 'NewsArea' already exists
3A) If it already exists, popup appears telling user that he/she can only create one NewsArea
3B) If doesn't exist already, then there is no problem and a new NewsArea will be created
Any idea on how I can tackle the above via code ?
Thanks!
Manu
http://our.umbraco.org/wiki/reference/api-cheatsheet/attaching-document-event-handlers
and
http://our.umbraco.org/wiki/reference/api-cheatsheet has a section - Using ApplicationBase to register events
Should allow you to hook into the before_save or publish or where ever your logic needs.. (eg you might want the user to be able to create multiple.. but only have one published at a time as an alternative)
is working on a reply...