I'm new to Umbraco's world and so far, I enjoy this great CMS!
I want to know if it's possible to create a DocumentType that can't be published? What I want to do is to create a list of interests(DocumentType that I don't want my users to publish), that I can use with UltimatePicker or TreeMultiPicker so that I can link all my documents to one or more fiel of interest. I can't create a DataType using a checkbox list because I want them to be hierarchical and possibly add weigth or other value.
A very good idea to do it this way, have made use of this technique quite a bit myself so far. Ideal if CMS users will be able to edit/add/delete items in the list themself, sort them etc. However I haven't found yet the need to not publish these item - usually they are not associated with a template, so even if the url is created for them you will not see anything. To be absolutely on the safe side you could add a custom Url rewriting rule which will redirect all these pages e.g. to the homepage.
In order to prevent the item from being published: I guess you can hook into the Document.AfterPublish event and either prevent publishing or un-publishing immediately afterwards. Don't know if you will see the items in the UltimatePicker or TreeMultiPicker though if they are not published.
I think I will do a default template witch redirect to the home page since they can create any "pages" in the tree and publish them. I can't beleeive that there is no way to do that in this CMS...
What you rewritting rule would look like, I'm not good at this :P
Create DocumentType that can,t be published
Hi,
I'm new to Umbraco's world and so far, I enjoy this great CMS!
I want to know if it's possible to create a DocumentType that can't be published? What I want to do is to create a list of interests(DocumentType that I don't want my users to publish), that I can use with UltimatePicker or TreeMultiPicker so that I can link all my documents to one or more fiel of interest. I can't create a DataType using a checkbox list because I want them to be hierarchical and possibly add weigth or other value.
If you have any suggestions let me know!
Thx a lot!
Hi Vincent,
A very good idea to do it this way, have made use of this technique quite a bit myself so far. Ideal if CMS users will be able to edit/add/delete items in the list themself, sort them etc. However I haven't found yet the need to not publish these item - usually they are not associated with a template, so even if the url is created for them you will not see anything. To be absolutely on the safe side you could add a custom Url rewriting rule which will redirect all these pages e.g. to the homepage.
In order to prevent the item from being published: I guess you can hook into the Document.AfterPublish event and either prevent publishing or un-publishing immediately afterwards. Don't know if you will see the items in the UltimatePicker or TreeMultiPicker though if they are not published.
Cheers,
Sascha
Hi Sahcha,
I think I will do a default template witch redirect to the home page since they can create any "pages" in the tree and publish them. I can't beleeive that there is no way to do that in this CMS...
What you rewritting rule would look like, I'm not good at this :P
Thx
Hi Vincent,
You would have to add something like this to the /config/UrlRewriting.config file:
virtualUrl="^~/[root/node/of/your/options]/(.*)"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/"
ignoreCase="true" />
This will redirect everything that tries to access anything in your /[root/node/of/your/options] folder to the homepage.
However as long as you don't put any links on your web site that sends the user to anywhere in that folder no one will probably land there anyway.
Cheers
Sascha
is working on a reply...