This project is read-only.

Dynamically duplicate a widget content

Topics: Customizing Orchard
Oct 16, 2012 at 6:15 AM

Hi there,

i have create simple widget which store data to DB with 1 textbox

i can dynamically adding a widget A to a page A with "my-text" as input. 

now i want to dynamically create page B with new widget B (same type as widget A) and the copy the content of widget A to widget B

---> i'm ok create new page B dynamically

---> i dont know how to copy the content widget A to widget B on Page B

any help would be very much appreciated.

many thanks.




Oct 16, 2012 at 4:55 PM

That doesn't sound like a widget, it sounds like a content part. Unless they really have the same contents in page A and page B, in which case you just need to change the layer rule to include both urls.

Oct 17, 2012 at 11:13 AM

Hey there.

I'm searching for the same issue as Jerry, so let me make the question clearer:

I'm trying to build 2 pages with the same widgets, for example,

- in page A we have widgets named wA, wB and wC.  

- Now I want to make a copy of page A named page B, and this page will also have copies of wA, wB and wC on its own layer (which will be set to serve for ONLY pageB's url), but I dont want the layer of page A to be served for page B, because on page B's layer I might need to add widget wD. Of course I know that we can change the pageA's layer to include the pageB's URL then create another layer that will serve for pageB only, but I dont want to do as complex as that.

In summary, I'd like to know how to copy the wA, wB and wC into any other layers.

Many thanks.


Oct 17, 2012 at 5:51 PM

So have one A and B layer, on A layer, and one B layer.

Oct 18, 2012 at 6:53 AM

hi bertrandleroy,


say in layer A, i have 1 widget that has 10 attributes. now in layer B, i would like to have same widget as there is in layer A, but with different attributes.

and since there is only 1 attribute different from widget on layer A and the one on layer B, i don't want to retype the similar attributes.

so my question is: is there a way to copy content (attributes) from a widget to another widget (same type of course)?

if you use 1 widget on 2 layers then actually it is 1 widget that is reused from 2 layer, that is not the purpose in my project.


hope that you can give me suggestion.

many thanks.




Oct 18, 2012 at 6:05 PM

Unfortunately no. Except if you write code for that of course.