Cloning designs and design customisations


(Jamie Smith) #1

Hello. Does anyone know of a way to quickly clone a Design asset and its Customisations?

 

It's a pretty time-consuming process to create a Design from scratch and manually add all the Customisations and Design Areas back in again, especially when a lot of the values remain the same as the Design you're "cloning".

 

Thanks in advance.


(Anthony) #2

I think I tried once and failed. I've also tried exporting from one system and importing into another (via the XML export) and that wasnt a big success either. I seem to recall in one instace I got it to look OK through the asset tree but in practice it dodntwork until I went into each screen manually and re-committed it.

 

Certainly interested to hear if anyone has it working (or add my +1 to a feature request)  as its something I need to do occasionally...


(Jamie Smith) #3

An update on this...

 

It turns out that you can use the JS API to clone Design Customisations (with all the specifics remaining in tact).

 

The steps to take:

  • Create the new Design asset in the asset map
  • Paste in the Parse File code from the Design you want to clone
  • Use the cloneAsset() method of the JS API to clone the Design Customisation to the new Design

The only issue is that all areas of the parse file are activated so you'll need to check 'Remove Customisation' for those that shouldn't be customised.

 

Make sure to clone as a TYPE_2 asset.

 

An example:

js_api.cloneAsset({
   "asset_id": 133024,
   "new_parent": 133689,
   "clone_num": 1,
   "link_type": "SQ_LINK_TYPE_2",
   "link_value": "",
   "dataCallback": function(data) { console.log(data); }
});

Note that the API call can take a minute or so to complete and return a success message.


(Ryan Archer) #4

How do you use the JS API???


(Bart Banda) #5

What version of Matrix are you in? In recent versions we've fixed up a few bugs with the export/import when it comes to designs, so might be worth doing an upgrade and testing it again. 


(Ryan Archer) #6

Oh man I would so love to do an upgrade! Absolutely itching for it. Just have bureaucratic obstacles right now.

We are using version 4.18.4