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:
Method | Return Type | Content Returned |
---|---|---|
$dotcontent.pull() | List of content objects | All content which matches the specified Lucene query |
$dotcontent.pullPerPage() | List of content objects | All content matching the specified query, paginated |
$dotcontent.pullRelated() | List of content objects | Related content matching the specified parameters |
$dotcontent.pullPersonalized() | List of content objects | Content matching the specified parameters, personalized for individual users |
$dotcontent.find() | Single content object | An 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>
-->