Copied to clipboard

Flag this post as spam?

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


  • tentonipete 78 posts 223 karma points
    May 12, 2011 @ 10:36
    tentonipete
    0

    Document type picker datatype?

    I'm asking if one of these exists somewhere already before I go and write one myself.

    I want to select a document type(s) and store the document type id (alias might change).

    Is a list of doctypes available using the API or do i need to go fiddling with the DB?

    I could filter all the content on nodeType but that would be expensive and only give me the document types currently in use.

    Thanks for the help.

  • tentonipete 78 posts 223 karma points
    May 12, 2011 @ 10:43
    tentonipete
    0

    I found this:

    umbraco.cms.businesslogic.web.DocumentType.GetAllAsList()
    

    i'm guessing that's the way to go if there's no document type picker datatype already.

     

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    May 12, 2011 @ 10:47
    Lee Kelleher
    0

    Hi Joel,

    Benjamin Howarth made one a while ago... on his project page.  Its says that it's compatible with v4.0 - so not sure if that means it's compatible with v4.5+

    Otherwise, roll your own and release the package? Woo!

    Cheers, Lee.

  • tentonipete 78 posts 223 karma points
    May 12, 2011 @ 11:01
    tentonipete
    0

    thanks for the tip off. i'll have a look at that now and see if it does what i want, and also see how he's getting the data!

  • aghy 129 posts 308 karma points
    May 12, 2011 @ 11:09
    aghy
    0

    Hi,

    Do you mean a picker like a Content Picker or Media Picker where the tree pops up and your able to navigate the structure to find the one you want?

    If you do then thats more complicated but would be very nice!

    I have recently made a datatype that asks for a Document Type and I just use the method you mentioned, DocumentType.GetAllAsList() and use it as the datasource on a DropDownList then bind the Text and UniqueID.

    If you want my code it's part of a bigger project but I can extract it for you just let me know.

    Ben

  • Jamie Howarth 306 posts 773 karma points c-trib
    May 12, 2011 @ 11:32
    Jamie Howarth
    0

    Hi all,

    Yes, I did start one of these a while back with 4.0 compatibility in mind, and for which I still have code booting around somewhere in the cobwebs of the Net :-)
    A document type provider for Universal Media Picker will be included with Blog4Umbraco v3 which is due for imminent release.

    Joel, if you want to check out the code in the B4U source, it's in /branches/try-codegecko-features/umbraco.blog4/DataTypes/UMPDoctypeProvider.

    HTH,

    Benjamin

  • tentonipete 78 posts 223 karma points
    May 12, 2011 @ 11:53
    tentonipete
    0

    thanks guys

    @aghy - yeah i want to pick one or many from a list of available document types

    @benjamin - so is the UMP provider model the recommended way to go with such developments? best practice and all that? thanks for the link, am all up in your codez right now!

  • Jamie Howarth 306 posts 773 karma points c-trib
    May 12, 2011 @ 11:56
    Jamie Howarth
    0

    @Joel IMO, yes, UMP is definitely the best way to go with hierarchical data in my view. Glad to be of help :-)

  • tentonipete 78 posts 223 karma points
    May 12, 2011 @ 14:14
    tentonipete
    0

    Thanks. Got it up and running.

    Would I be right in thinking that you can only pick a single item and not multiple with UMP or is that just your specific implementation in this case?

  • Jamie Howarth 306 posts 773 karma points c-trib
    May 12, 2011 @ 15:31
    Jamie Howarth
    0

    I honestly don't know actually! I'm assuming single-item though, as I don't know what would be required to make it multi-item-capable (just rewalked my code). Better ask the karminator!

  • tentonipete 78 posts 223 karma points
    May 12, 2011 @ 17:10
    tentonipete
    0

    the karminator confirms UMP does not support multiple selections

  • tentonipete 78 posts 223 karma points
    May 23, 2011 @ 10:22
    tentonipete
    1

    thanks to inspiration from benjamin and a kick up the ass from lee, have rolled own which allows selection of multiple doctypes.

    find here: http://our.umbraco.org/projects/backoffice-extensions/document-type-picker

     

Please Sign in or register to post replies

Write your reply to:

Draft