Webmasters can enable content contributors to edit pulled content directly from the page it's displayed on. This speeds up content review and editing since contributors do not have to search for the displayed content to make changes. There are two ways to do this:
Display Edit Button on Dynamic Content
#editContentlet() macro creates an edit icon with a link to edit a contentlet being dynamically displayed from a content pull.
- inode: The inode of the contentlet to edit.
Place this macro immediately after a foreach loop so that content editors can edit each contentlet displayed by the content pull.
A simple example using the required fields:
#foreach($con in $dotcontent.pull("+contentType:News +(conhost:48190c8c-42c4-46af-8d1a-0cd5db894797 conhost:SYSTEM_HOST)",10,"News.title")) #editContentlet($con.inode) $con.title #end
Inline Content Editing
Inline content editing allows a user to directly edit the pulled content within the front-end page.
Note: This feature is only available with a dotCMS Enterprise license.
If a user is browsing a page from the front end of a site (for example: http://demo.dotcms.com/products/asset-allocation and realizes that there is an edit needed to the content on that page, simply visiting http://demo.dotcms.com/edit will (after user login), allow the permissioned backend user to edit that specific page. In addition, the user can edit the content without clicking the content edit button if the webmaster takes advantage of the dotedit tool (as shown below).
To enable inline editing webmasters can place the following code in the container or widget displaying that is displaying the desired content:
In a Container (where body is the desired inline edit content field):
With URLmapped Content Fields:
For Dynamically/Programatically Pulled Content:
Multiple Content Fields on the Same Piece of Content:
<h1>#dotedit($inode, $title)</h1> #dotedit($inode, $body)