Dotcontent Viewtool

Last Updated: Feb 23, 2024
documentation for the dotCMS Content Management System

The $dotcontent Velocity Viewtool is used to pull individual content items or lists of content from the content repository via Velocity, using Lucene queries.

Usage

There are many different methods to pull content using the $dotcontent tool. For more information, on each method, please click the links below:

MethodReturn TypeContent Returned
$dotcontent.pull()List of content objectsAll content which matches the specified Lucene query
$dotcontent.pullPerPage()List of content objectsAll content matching the specified query, paginated
$dotcontent.pullRelated()List of content objectsRelated content matching the specified parameters
$dotcontent.pullPersonalized()List of content objectsContent matching the specified parameters, personalized for individual users
$dotcontent.find()Single content objectAn individual content item specified by identifier

Content Limit on Pull

For all pull methods the default limit is 10,000 pieces of content. (Attempts to specify a number higher than 10,000 result in the maximum available contentlets being pulled.) However, this limit can be circumvented using the method below.

Bypass Pagination

To see as many content items as you would like above 10,000 without pagination, we would use the Scroll API to get the entire list of elements by calling:

With this, you may set the second parameter to anything above 10K, as in this example we successfully passed `10001`.


## Toolbox.xml Configuration {#ToolboxXml}

The following example shows how the dotcontent Viewtool is mapped in the [toolbox.xml](toolbox-xml) file:
<tool>
    <key>dotcontent</key>
    <scope>request</scope>
    <class>com.dotcms.rendering.velocity.viewtools.content.ContentTool</class>
</tool>
<!--## References {#References}

* <a href="/docs/javadocs/latest/com/dotcms/rendering/velocity/viewtools/content/ContentTool.html" target="_blank">ContentTool Javadocs</a>
-->

On this page

×

We Dig Feedback

Selected excerpt:

×