Copy a document in the tree, possible to make a shadow copy of it? Options
Anders
Posted: Thursday, February 14, 2008 10:41:57 AM

Rank: Devotee

Joined: 5/24/2007
Posts: 59
Location: Kalix, Sweden
I was wondering if it would be possible to make a shadow copy of a document. Like copy a document so it just sits in the tree and is updated with data from the orginal document....



Umbraco Certified Professional
imayat12
Posted: Thursday, February 14, 2008 11:54:00 AM

Rank: Addict

Joined: 7/19/2006
Posts: 593
Location: Preston, UK
Anders,

Not tried this but as a thought you could create a copy make sure the check box Relate copied items to orignal is checked. You could create an action handler that could handle update / delete etc and in the handler for the document check if it has relations if it does then get the related item and update its content.

You may need to create a separate document type for it and in your actionahandler only for that type do the relation check else you will for every document type do a relation check. There may be other issues but you wont know until you try :)

Regards

Ismail

Level 2 certified. If it aint broke dont fix.
Anders
Posted: Thursday, February 14, 2008 12:52:50 PM

Rank: Devotee

Joined: 5/24/2007
Posts: 59
Location: Kalix, Sweden
That might do the trick. Will give it a shot perhaps if I dont figure out a driffrent structure.


Umbraco Certified Professional
imayat12
Posted: Thursday, February 14, 2008 12:56:28 PM

Rank: Addict

Joined: 7/19/2006
Posts: 593
Location: Preston, UK
Anders,

Save you some digging in the docs umbraco.cms.businesslogic.relation.Relation.GetRelations(System.Int32) is the call where int is the node id.

Regards

Ismail

Level 2 certified. If it aint broke dont fix.
Anders
Posted: Thursday, February 14, 2008 2:15:06 PM

Rank: Devotee

Joined: 5/24/2007
Posts: 59
Location: Kalix, Sweden
Got me started thinking. What if i made a new documentype that only has a property which document that is related to it. On on that documenttype I make a user control that grabs the specfied page and render it as would be an exact copy of the page...

That might even be a better way to do it, as it can be confusing that a page can be edited but when the "master" is updated that page also changes...

Anyone done this before?

Umbraco Certified Professional
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.