Copied to clipboard

Flag this post as spam?

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


  • Eric Warren 48 posts 68 karma points
    Aug 04, 2010 @ 04:16
    Eric Warren
    0

    Document Type That add a set of Document types?

    I was wondering if some one could point me in the right direction on where to start this project.  I am wanting to create a Doc Type that add a set of new document  types.  So  I have a rotating banner that I want to be able to go to the contentsection and select add new banner and it populates ( image picker, and Content picker ) and populate code for the banner. And you can do this up to five times.   I know this will probably have to be done with C# and some other programming.  I just wonder if someone has already done this and if they could point me in the right direction.

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Aug 04, 2010 @ 04:45
    Aaron Powell
    0

    Do you mean that you're automatically get the children created? If so then you'll probably have to custom code it. I haven't seen a project which does this for you (it'd be a bit tricky to handle with the config).

    Here's a sample event handler for you though:

    void Document_New(Document sender, NewEventArgs e) {
        string alias = sender.ContentType.Alias;
        if(alias == "MyType") {
            Document.MakeNew("Tabs", DocumentType.GetByAlias("Page Tab Container"), u, sender.Id);
            Document.MakeNew("Download Items", DocumentType.GetByAlias("Container"), u, sender.Id);
            Document.MakeNew("News Ticker", DocumentType.GetByAlias("Container"), u, sender.Id);
        }
    }
  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Aug 05, 2010 @ 13:08
    Tim
    0

    Does it need to be a document type? If it's just up to fove sets of banner code you're after, you caould have a look at the repeatable content plugin: http://our.umbraco.org/forum/ourumb-dev-forum/features/3824-repeatable-content-data-type that allows you to set up a mini-doctype that doesn't have any actual page associated with it (which I assume you wouldn't for a banner) and you can limit the number of times it can be added.

  • Eric Warren 48 posts 68 karma points
    Aug 05, 2010 @ 13:40
    Eric Warren
    0

    Thanks Guys,  I think i have a good place to start.  Thanks for you Help

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies