Create an asset with a Page chooser in the data definition using web services
I'm using web services to create some page assets in the CMS. One of the pages has a Page chooser in the data definition. I am using PHP web services to create the page. I can get all the text values to populate correctly, but I can't figure out how to populate the Page chooser (supervisor) field.
Ex: Here is the data definition.
<text identifier="position-title" label="Position Title"/>
<text identifier="additional-positions" label="Additional Positions" multiple="true"/>
<asset type="page" identifier="supervisor" label="Supervisor"/>
<text identifier="division" label="Division"/>
<text identifier="division-folder" label="Folder" restrict-to-groups="comm-admins"/>
<text identifier="dean" label="Dean"/>
<text identifier="dean-folder" label="Folder" restrict-to-groups="comm-admins"/>
<text identifier="department" label="Department"/>
<text identifier="department-folder" label="Folder" restrict-to-groups="comm-admins"/>
Ex of the PHP code for setting up the data
// Organization Information Group - Title, Supervisor, Division, Dean, Department
array (
'type' => 'group',
'identifier' => 'organization-information',
'structuredDataNodes' => array (
'structuredDataNode' => array (
// Employee Type
array (
'type' => 'text',
'identifier' => 'employee-type',
'text' => $aProfileData['employeeType']
),
// Position Title
array (
'type' => 'text',
'identifier' => 'position-title',
'text' => $aProfileData['title']
),
// Supervisor
array (
'type' => 'asset',
'asset-type' => 'Page',
'identifier' => 'supervisor',
'path' => '/index'
),
// Division
array (
'type' => 'text',
'identifier' => 'division',
'text' => $aProfileData['division']
),
// Division Folder
array (
'type' => 'text',
'identifier' => 'division-folder',
'text' => $aProfileData['divisionFolder']
),
//Dean
array (
'type' => 'text',
'identifier' => 'dean',
'text' => $aProfileData['dean']
),
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Wing Ming Chan on 02 Mar, 2016 02:28 PM
Hi,
You should know of my library by now. To use my library:
To use raw code, you should set both the
pageId
andpagePath
properties:Wing
2 Posted by ediego on 02 Mar, 2016 02:30 PM
We are aware of the library and started migrating some of our web services to use it. thanks for the library and the response :)
3 Posted by Wing Ming Chan on 02 Mar, 2016 02:48 PM
For your information, these are the upcoming hangout events:
Web Services Online Tutorials
One Template, One Region, and Lots of Velocity Tricks
Wing
Tim closed this discussion on 23 Mar, 2016 06:42 PM.