Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8832637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:34:46+00:00 2026-06-14T08:34:46+00:00

[Edit] I have actually been allowed to use the doc names, which makes it

  • 0

[Edit] I have actually been allowed to use the doc names, which makes it much easier but I still think it would be interesting to find out if it is possible.

I have to set a trigger to duplicate content to different branches on the content tree as the site will be in several languages. I have been told that I cannot access the documents by name(as they may change) and I shouldn’t use node IDs either(not that I would know how to, after a while it would become difficult to follow the structure).

How can I traverse the tree to insert the new document in the relevant sub branches in the other languages? Is there a way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:34:47+00:00Added an answer on June 14, 2026 at 8:34 am

    You can use the Document.AfterPublish event to catch the specific document object after it’s been published. I would use this event handler to check the node type alias is one that you want copied, then you can call Document.MakeNew and pass the node ID of the new location.
    This means you don’t have to use a specific node ID or document name to trap an event.

    Example:

    using umbraco.cms.businesslogic.web;
    using umbraco.cms.businesslogic;
    using umbraco.BusinessLogic;
    
    namespace MyWebsite {
        public class MyApp : ApplicationBase {
            public MyApp()
                : base() {
                Document.AfterPublish += new Document.PublishEventHandler(Document_AfterPublish);
            }
    
            void Document_AfterPublish(Document sender, PublishEventArgs e) {
                if (sender.ContentType.Alias == "DoctypeAliasOfDocumentYouWantToCopy") {
                    int parentId = 0; // Change to the ID of where you want to create this document as a child.
                    Document d = Document.MakeNew("Name of new document", DocumentType.GetByAlias(sender.ContentType.Alias), User.GetUser(1), parentId)
                    foreach (var prop in sender.GenericProperties) {
                        d.getProperty(prop.PropertyType.Alias).Value = sender.getProperty(prop.PropertyType.Alias).Value;
                    }
                    d.Save();
                    d.Publish(User.GetUser(1));
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to use regex but I cant seem to get it
Edit: I think this has been answered successfully, but I can't check 'til later.
EDIT I have finally figured out the problem i have been having on my
EDIT: I have fixed all but two warnings now, so thank you all for
I have an edit text which functions as a search box in my application.
I have been given an SWF to edit a link in the AS code.
Salutations I have been trying to find a way to edit an Ember.Select box
I have been using metaprogramming quite a lot, but sometimes the combination of c
(EDIT: Question changed.) I have a product with an installer which was built by
EDIT: I have edited my post... Working on a project (c#), I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.