Add buttons are missing in Page Builder after upgrading jContent to 3.7.x
Question
After upgrading jContent, editors can no longer add child content to a list-like component in Page Builder:
- The hover "add" button around the existing children is no longer displayed.
- The right-click Create action on an existing child is no longer offered.
- No error message appears. The actions are simply gone.
The same page and content worked in jContent 3.6.x.
Applies to: jContent 3.7.0 and later (for example when upgrading from jContent 3.6.x), Jahia 8.2.x, and custom modules whose views render child nodes themselves.
Cause
Since jContent 3.7.1, jContent decides what can be added to a node by inspecting the rendered edit-mode HTML of the page. It looks for the wildcard placeholder (path="*") emitted by <template:module>, and no longer relies on the node type definition alone.
If a view renders its children with a plain loop and never emits that placeholder, jContent cannot tell that new children are allowed, so it hides the add actions. For example, this view does not emit a placeholder:
<c:forEach items="${currentNode.nodes}" var="child">
<li><template:module node="${child}" templateType="html"/></li>
</c:forEach>
This is intended behavior. jContent reads the rendering because a view can apply conditions that the node type definition cannot express, such as a hard-coded limit on the number of children. jContent 3.6.x was more permissive and offered the add actions even when the view did not state that children could be added. For custom views that relied on that, this is a behavior change, so modules that render their own children need to be updated when moving to jContent 3.7.x.
Solution
Make the view state explicitly what can be added, by emitting a path="*" placeholder in edit mode only:
<c:forEach items="${currentNode.nodes}" var="child">
<li><template:module node="${child}" templateType="html"/></li>
</c:forEach>
<c:if test="${renderContext.editMode}">
<li><template:module path="*" nodeTypes="mynt:employee"/></li>
</c:if>
- Wrap the placeholder in
renderContext.editModeso that it does not appear on the live site. nodeTypesrestricts the placeholder to the listed node types. If the parent definition accepts children of any type, you can omit it.- Place the placeholder where your markup allows the element, for example inside an
<li>when the children sit in an<ol>or<ul>. - If a view should stop accepting children (for example after reaching a limit), emit the placeholder only while the limit has not been reached. jContent hides the add actions once the placeholder is gone.
If the placeholder is skipped for a definition that allows subnodes, editors cannot add child content through the jContent UI.
Checking the fix: redeploy the module and open the page in Page Builder. The add button should appear again around the existing children, and Create should be available in the right-click menu. An empty list should offer the add action too.
Related documentation: