Edit the XML source to make copies of components?

  • 1
  • Question
  • Updated 3 years ago
  • Answered
How can I edit the XML raw and copy code that contains a panel set with field editors 100 times?

I have to set up my page with 100's of panel sets and field editors and Click and drag is getting tiresome. Any ideas how i can maybe edit the raw page and copy components?
Photo of Jarrod Hinson

Jarrod Hinson

  • 2,310 Points 2k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
When the page doesn't have any unsaved changes there will be an "Edit XML" link at the bottom right of the page.   You can grab the XML there and put it in your favorite text editor.  Or just edit there. 
Photo of Jarrod Hinson

Jarrod Hinson

  • 2,310 Points 2k badge 2x thumb
Wow... thats easy I am so blind i looked everywhere but there!
Photo of Mike Dwyer

Mike Dwyer

  • 3,390 Points 3k badge 2x thumb
I copied the xml for one Tab on a page, from <tab name="x"> to </tab>. But the new tab does not render. I see that there is a <skootable> tag that includes a unique ID, so I deleted the duplicate xml, created a tab with a table (empty), and then copied everything between the source <skootable> tags to the new <skootable>. Still no tab. It appears that other components have unique ID's so I am suspecting that to be my problem. Is there an easy way to have those unique ID's generated without creating each component and replacing their xml? Otherwise, it would be just about as easy to do it all by hand.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Mike,

You should be able to copy and paste components within the same page and ignore the unique id... as far as I understand it that will only impact personalizations.

Are you saying that the XML you're pasting isn't showing up in the builder, or in runtime?
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
Mike, I've copied XML snippets many times w/o issues.  Maybe you are not bringing over everything?  Hard to say w/o looking at the XML.
Photo of Mike Dwyer

Mike Dwyer

  • 3,390 Points 3k badge 2x thumb
The new tab does not appear in the page Preview. When I had copied everything within <tab...</tab>, the components did not even appear in the page builder.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
If you give us the relevant xml, we'll take a look.
Photo of Mike Dwyer

Mike Dwyer

  • 3,390 Points 3k badge 2x thumb
It's over 500 lines. What is the protocol for sharing that length of code. (I'm new here.) Oh, yes. I suppose you would need the entire page and not just the part I'm copying?
(Edited)