Queries the AssetRelationTree table and builds a list of child assets for the specified parent asset.
<asset:children name="assetName" [type="parent assettype"] [assetid="parent assetid"] list="listName" [code="NameOfAssociation"] [objecttype="typeOfObject"] [objectid="objectID"] [deptype="exact|exists|none"] [order="nrank"]/>
name
(required unless type and assetid supplied)
asset:load
.)
type (required if name is not used)
type+assetid
or name must be supplied to
identify the parent asset.
assetid (required if name is not used)
type+assetid
or name must be supplied to
identify the parent asset.
list (required)
objecttype
parameter, the
asset table. If a list with this name already exists, it is
replaced with this new list.
code (optional)
objectype="Image"
and
code="MainImage"
for an article asset, Sites
lists only the image asset that is related to that article asset by
the Main Image named association. Without the code
entry, Sites lists all the images associated with the article.
code= "-"
If you do not specify objecttype
or code
, the list includes all children with named
associations or unnamed relationships to the parent asset.
objecttype (optional)
objecttype
, the list of children is a join of the
AssetRelationTree and the asset table for the type specified.
To request a specific child asset, combine this parameter withobjectid
. Note that if you include anobjectid
,objecttype
is not optional.
objectid
(optional)
objectid
and an
objecttype
to request a specific child.
deptype (optional)
exact
, exists
, or none
.Legal values are:
exact
(default)
-- Exact
specifies a version dependency. The version of the
dependent asset must be equal to the version of the asset when it
was approved.
exists
-- Exists
specifies that any version of the asset satisfies
the dependency condition.
none
-- None
specifies no approval dependency on the asset.
order
(optional)
asc
) or descending (desc
).
By default, the sort is ascending. If you specify more than one
field, separate the field names with a comma.
order="nrank"
,
the list is sorted by rank starting at number 1. If you want the
list sorted by descending rank, use order="nrank desc".
This tag queries the AssetRelationTree table for a list of the children of the asset that you specify, listing each child with a value for all of the fields from that table (nid
,nparentid
,nrank
,otype
,oid
, andncode
). You must either load the parent asset (asset:load ) before you can invoke this tag or specify thetype
andassetid
.
For example, you can use this tag to retrieve the assets referred to by a collection asset or the image assets associated with an article asset. You can then loop through the list, or reference the data returned in the list to display the relevant information from those assets.
You can restrict the list of children by association name
(code
), object type and object ID.
If you use the objecttype
parameter, the
resulting list of children is a join of the AssetRelationTree and the
asset table for the type specified and contains data from both
tables. In such a case, you do not need to use asset:load
to load the child asset to get asset data from the primary asset
table.
For more information about the columns of the AssetRelationTree table, see the section in the Developer's Guide entitled "Tree Tables" in Chapter 12.
The possible values of errno
include:
Value |
Description |
---|---|
-111 |
The asset has no children. |
-10004 |
A required parameter is missing. |
-10005 |
The requested object is not in the object pool (is not loaded into memory). |
-10006 |
The object ID is not valid. |
-10007 |
The version of the object is not valid. |
This code retrieves the query asset that has been
associated with a parent asset through the LatestNews association and
writes it to a list named LatestNewQuery
:
<asset:children name="HomePage" list="LatestNewQuery" objectype="Query" code="LatestNews"/>
This code retrieves the query asset that has been associated with a parent asset through the LatestNews association without loading the asset:
<asset:children type="Page" assetid='<%=ics.GetVar("cid")%>' list="LatestNewQuery" objectype="Query" code="LatestNews"/>
This code retrieves a collection of articles, determines the members of the collection, and then displays the Description field of each article:
<asset:load name="NewsCollection" type="Collection" objectid='<%=ics.GetVar("id")%>'/> <asset:get name="NewsCollection" field="name"/><br/> <asset:children name="NewsCollection" code="-" order="nrank" objecttype="Article" list="articleList"/> <ics:listloop listname="articleList"> <ics:listget listname="articleList" fieldname="description"/><br/> </ics:listloop>
asset:childtypes
asset:legalchildtypes
asset:list
asset:load