Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Does anyone know if you can copy a publishing page (programmatically), based on a custom layout and content type, from one site to another in different site collections and keeping all the data in the fields or webparts. Basicly to create a feature receiver that has code to copy the instance of page P from site A in site collection SCA to Site B in site collection SCB.

The big picture here is to create a page inside a variation and place a flag in the edit mode panel of that page. When the flag is set to true and the page is approved, it should be pushed to all variations as a draft (workflow) in another region. example:

  • Site Collection SCA: North America Region with variations en-US en-CA with en-US as root
  • Site Collection SCB: Europe Region with variations en-UK es-ES with en-UK as root

I create page P on en-US (root of North America Region) on publish it is pushed to all variations inside that region. If the flag is set to true, then the page is pushed as a draft to the root of the Europe Region (en-UK).

share|improve this question

2 Answers 2

up vote 0 down vote accepted

If you are using variations why not just set the "Automatically create site and page variations" (in Site Collection settings -> Variation settings) which will copy the newly created pages in your Variations?

In the case where you want pages in variation sites to be copied to target sites on demand only, you can use the on demand page propagation, which is detailed in this article

http://blogs.msdn.com/b/ecm/archive/2010/06/22/variations-propagate-pages-on-your-terms.aspx

share|improve this answer
    
Thanks for your answer, it's good for what I asked, too bad that the question I posted didn't cover what I wanted (I'll down vote myself :)) ) I'll edit the question, feel free to give it a go after that. –  Mihai Brustur Mar 23 '11 at 9:41
    
Right, that's much clearer now :) Just one more question: Do you want to preserve the connection between the copied pages for managing updates to those? For example in your scenario where page P in the root of North America Region is updated and therefore pushed to all variations inside that region. With it's flag set to true, should the page be pushed again to the root of the Europe Region (en-UK)? –  Elena Mar 23 '11 at 9:56
    
No. First of all the push flag is available only for pages in the variation root. And second, after page is pushed from NA Region to EU Region the connection is broken; only one push is possible, after that content authors for each region can modify the page as they want without changing anything to other regions. Does this answer your question? –  Mihai Brustur Mar 23 '11 at 10:05
    
Ok, so copying the page itself should not be a problem however the complexity lies in its dependencies, e.g. web parts, custom fields, dependent content types etc. To grab all dependencies in the propagation there'll need to be quite a lot of custom logic in your receiver, however there may be an easier way using an event receiver that triggers a Quck Deploy job using the Content Deployment API msdn.microsoft.com/en-us/library/… I hope this helps –  Elena Mar 23 '11 at 12:23
    
I hope so too. I'll get back to you with a result in a few days I hope, depending on the time I have at my disposal. Many thanks for the quick answers. –  Mihai Brustur Mar 23 '11 at 12:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.