Display Structure Information in a Content Pull - Documentation topics on: content,dynamic content,structure,.

Display Structure Information in a Content Pull

While using the content tool, webmaster's can pull the name and description fields of the Content Type while pulling the contentlet dynamically on a page. Take the following simple velocity pull of content which pulls employee names.

#foreach($employee in $dotcontent.pull("+contentType:Employee +(conhost:48190c8c-42c4-46af-8d1a-0cd5db894797 conhost:SYSTEM_HOST)",5,"Employee.lastName"))
    <p>
        $velocityCount. $employee.lastName, $employee.firstName
    </p>
#end

If desired, more properties of the Content Type can also be displayed, in addition to the content being pulled. In the following code example, the following method: [content item variable].structure.[content type property] is used to display the properties of the Content Type itself in velocity, before displaying a list of 5 employees.

#foreach($employee in $dotcontent.pull("+contentType:Employee +(conhost:48190c8c-42c4-46af-8d1a-0cd5db894797 conhost:SYSTEM_HOST)",5,"Employee.lastName"))
    <h2>Content Type: $employee.structure.name</h2>
    #if($velocityCount == 1)
        <ul>
            <li>Description: $employee.structure.description</li>
            <li>Velocity Variable: $employee.structure.velocityVarName</li>
            <li>Detail Page: $employee.structure.pagedetail</li>
            <li>URL Map Pattern: $employee.structure.urlMapPattern</li>
            <li>Base Type: $employee.structure.baseType<br />
                <i>(Content=1; Widget=2; Form=3; File=4)</i></li>
            <li>Host : $employee.structure.host</li>
            <li>Folder: $employee.structure.folder</li>
            <li>Publish Date Variable: $employee.structure.publishDateVar</li>
            <li>Expire Date Variable: $employee.structure.expireDateVar</li>
            <li>Content Type Inode: $employee.structure.inode</li>
        </ul>
    #end
    $velocityCount. $employee.lastName, $employee.firstName
#end