Set Webpath Using SOAP


(Nic Hubbard) #1

Is there a way to set the web path for an asset using SOAP?


Also, is there a way to set a body copy divs contents?


(Mahearnpad) #2

Hi Nic


This is old so you've probably found the solution, but to your second question about the bodycopy, here's some code I used to add some html to a bodycopy div - hope you can just work it out for what you want.


[quote]

// Now under the new asset, get the bodycopy asset and set the wysiwyg div to html type

// Use getChildren() to get the bodycopy child of this asset

// Unfortunately we need to go down another 3 levels below the standard page asset

$bodycopyDiv = array(

'AssetID'=>$newAssetID,

'TypeCode'=>'content_type_wysiwyg',

'StrictTypeCode'=>'TRUE',

'MinDepth'=>'3',

'MaxDepth'=>'3'

);



$getBcDiv = $client->GetChildren($bodycopyDiv);

//$objBcDiv = (object)$getBcDiv; //cast as correct datatype so we can get the returned value

//$bcDivAssetID = $objBcDiv->AssetID; //doesn't return a bloody assetID!

//print_r($getBcDiv->GetChildrenResult);

$bcDivAssetID = $getBcDiv->GetChildrenResult->AssetID;



//now change the attribute value for the html attribute inside the bodycopy div

$bcChangeAttribute = array(

'AssetID'=>$bcDivAssetID,

'AttributeName'=>'html',

'AttributeValue'=>$html

);



$insertHTML = $client->setAttributeValue($bcChangeAttribute);

[/quote]


(Nic Hubbard) #3

[quote]
Hi Nic



This is old so you've probably found the solution, but to your second question about the bodycopy, here's some code I used to add some html to a bodycopy div - hope you can just work it out for what you want.

[/quote]



Thanks. I need to figure it out without any code changes, but this might have sparked an idea. :slight_smile:


(Mahearnpad) #4

Did you find a way to set the webpath? I may need to do this also. Would be very useful if you've solved it.


(Nic Hubbard) #5

[quote]
Did you find a way to set the webpath? I may need to do this also. Would be very useful if you've solved it.

[/quote]



No, I have not revisited it. :frowning:


(Pheasley) #6

Version 4.12.2 introduced SetAssetWebPaths() to the SOAP web service. 

That still leaves me scratching my head how to update the URLs though.


(Nic Hubbard) #7

Version 4.12.2 introduced SetAssetWebPaths() to the SOAP web service. 

That still leaves me scratching my head how to update the URLs though.

 

Yeah, I saw that. Very nice.

 

It is pretty simple to use. There is an example in the manuals.