You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2018/12/05 05:31:49 UTC

[sling-org-apache-sling-app-cms] 02/02: Adding the References widget to a number of areas and improving the look / functionality of references

This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch SLING-8074-improve-reference-list
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git

commit 642d1efe1c0105b02f3648d946c39ba206001f81
Author: Dan Klco <dk...@apache.org>
AuthorDate: Wed Dec 5 00:31:08 2018 -0500

    Adding the References widget to a number of areas and improving the look
    / functionality of references
---
 .../main/java/org/apache/sling/cms/Reference.java  |  71 ++++++++
 .../main/java/org/apache/sling/cms/References.java |   2 +-
 .../java/org/apache/sling/cms/package-info.java    |   2 +-
 .../cms/core/internal/models/ReferencesImpl.java   |   7 +-
 .../components/cms/references/references.jsp       |  70 ++++++++
 .../editor/fields/references/references.jsp        | 100 ++++++++---
 .../libs/sling-cms/content/config/list.json        |  14 ++
 .../jcr_root/libs/sling-cms/content/page/edit.json |  17 +-
 .../libs/sling-cms/content/shared/references.json  |   2 +-
 .../libs/sling-cms/content/site/content.json       |  42 ++++-
 .../libs/sling-cms/content/siteconfig/editor.json  | 191 +++++++++++----------
 .../libs/sling-cms/content/static/content.json     |  28 +++
 .../libs/sling-cms/content/taxonomy/list.json      |   7 +
 13 files changed, 415 insertions(+), 138 deletions(-)

diff --git a/api/src/main/java/org/apache/sling/cms/Reference.java b/api/src/main/java/org/apache/sling/cms/Reference.java
new file mode 100644
index 0000000..8ae9d2f
--- /dev/null
+++ b/api/src/main/java/org/apache/sling/cms/Reference.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.cms;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.sling.api.resource.Resource;
+
+public class Reference {
+
+    private final String property;
+    private final Resource resource;
+
+    public Reference(Resource resource, String property) {
+        super();
+        this.resource = resource;
+        this.property = property;
+    }
+
+    /**
+     * @return the property
+     */
+    public String getProperty() {
+        return property;
+    }
+
+    public String getSubPath() {
+        return StringUtils.replaceOnce(resource.getPath(), getContainingPage().getPath(), "");
+    }
+
+    /**
+     * @return the resource
+     */
+    public Resource getResource() {
+        return resource;
+    }
+
+    public boolean isPage() {
+        PageManager pageMgr = resource.adaptTo(PageManager.class);
+        if (pageMgr != null) {
+            return pageMgr.getPage() != null;
+        }
+        return false;
+    }
+
+    public Page getContainingPage() {
+        PageManager pageMgr = resource.adaptTo(PageManager.class);
+        if (pageMgr != null) {
+            return pageMgr.getPage();
+        }
+        return null;
+    }
+
+    public String toString() {
+        return resource.getPath() + "@" + property;
+    }
+
+}
diff --git a/api/src/main/java/org/apache/sling/cms/References.java b/api/src/main/java/org/apache/sling/cms/References.java
index ba60cc5..14f3cb5 100644
--- a/api/src/main/java/org/apache/sling/cms/References.java
+++ b/api/src/main/java/org/apache/sling/cms/References.java
@@ -32,6 +32,6 @@ public interface References {
      * 
      * @return the list of reference path / properties
      */
-    List<String> getReferences();
+    List<Reference> getReferences();
 
 }
diff --git a/api/src/main/java/org/apache/sling/cms/package-info.java b/api/src/main/java/org/apache/sling/cms/package-info.java
index ed64073..ed902f1 100644
--- a/api/src/main/java/org/apache/sling/cms/package-info.java
+++ b/api/src/main/java/org/apache/sling/cms/package-info.java
@@ -23,5 +23,5 @@
  *
  * @since 0.10.0
  */
-@org.osgi.annotation.versioning.Version("0.11.0")
+@org.osgi.annotation.versioning.Version("0.12.0")
 package org.apache.sling.cms;
diff --git a/core/src/main/java/org/apache/sling/cms/core/internal/models/ReferencesImpl.java b/core/src/main/java/org/apache/sling/cms/core/internal/models/ReferencesImpl.java
index f972b18..41b842f 100644
--- a/core/src/main/java/org/apache/sling/cms/core/internal/models/ReferencesImpl.java
+++ b/core/src/main/java/org/apache/sling/cms/core/internal/models/ReferencesImpl.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.sling.api.resource.Resource;
+import org.apache.sling.cms.Reference;
 import org.apache.sling.cms.References;
 import org.apache.sling.models.annotations.Model;
 
@@ -29,19 +30,19 @@ import org.apache.sling.models.annotations.Model;
 @Model(adaptables = Resource.class, adapters = References.class)
 public class ReferencesImpl extends ReferenceOperation implements References {
 
-    private List<String> referenceList = new ArrayList<>();
+    private List<Reference> referenceList = new ArrayList<>();
 
     public ReferencesImpl(Resource resource) {
         super(resource);
     }
 
-    public List<String> getReferences() {
+    public List<Reference> getReferences() {
         init();
         return referenceList;
     }
 
     @Override
     public void doProcess(Resource r, String matchingKey) {
-        referenceList.add(r.getPath() + "@" + matchingKey);
+        referenceList.add(new Reference(r, matchingKey));
     }
 }
diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/references/references.jsp b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/references/references.jsp
new file mode 100644
index 0000000..80cf2c1
--- /dev/null
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/references/references.jsp
@@ -0,0 +1,70 @@
+<%-- /*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */ --%>
+ <%@include file="/libs/sling-cms/global.jsp"%>
+<sling:adaptTo var="references" adaptable="${slingRequest.requestPathInfo.suffixResource}" adaptTo="org.apache.sling.cms.References" />
+<table class="table">
+    <thead>
+        <tr>
+            <th>Type</th>
+            <th>Content</th>
+            <th>Subpath</th>
+            <th>Property</th>
+    </thead>
+    <tbody>
+        <c:forEach var="ref" items="${references.references}">
+            <tr>
+                <c:choose>
+                    <c:when test="${ref.page}">
+                        <td>
+                            <span class="icon">
+                                <span class="jam jam-document"></span>
+                            </span>
+                        </td>
+                        <td title="${ref.containingPage.path}">
+                            <a href="/cms/site/content.html${ref.containingPage.parent.path}">
+                                ${sling:encode(ref.containingPage.title,'HTML')}
+                            </a>
+                        </td>
+                        <td>
+                            ${sling:encode(ref.subPath,'HTML')}
+                        </td>
+                        <td>
+                            ${sling:encode(ref.property,'HTML')}
+                        </td>
+                    </c:when>
+                    <c:otherwise>
+                        <td>
+                            <span class="icon">
+                                <span class="jam jam-file"></span>
+                            </span>
+                        </td>
+                        <td>
+                            ${ref.resource.path}
+                        </td>
+                        <td>
+                        </td>
+                        <td>
+                            ${sling:encode(ref.property,'HTML')}
+                        </td>
+                    </c:otherwise>
+                </c:choose>
+            </tr>
+        </c:forEach>
+    </tbody>
+</table>
\ No newline at end of file
diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/references/references.jsp b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/references/references.jsp
index 3169e27..ec6709d 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/references/references.jsp
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/references/references.jsp
@@ -18,36 +18,80 @@
  */ --%>
  <%@include file="/libs/sling-cms/global.jsp"%>
 <c:if test="${slingRequest.requestPathInfo.suffix != null}">
-	<sling:getResource path="${slingRequest.requestPathInfo.suffix}" var="editedResource" />
-	<c:set var="editProperties" value="${sling:adaptTo(editedResource,'org.apache.sling.api.resource.ValueMap')}" scope="request"/>
+    <sling:getResource path="${slingRequest.requestPathInfo.suffix}" var="editedResource" />
+    <c:set var="editProperties" value="${sling:adaptTo(editedResource,'org.apache.sling.api.resource.ValueMap')}" scope="request"/>
 </c:if>
 
 <sling:adaptTo var="references" adaptable="${slingRequest.requestPathInfo.suffixResource}" adaptTo="org.apache.sling.cms.References" />
 <c:if test="${fn:length(references.references) gt 0}">
-	<div class="box field ${properties.toggle ? 'is-hidden toggle-value' : ''}" data-toggle-source=":operation" data-toggle-value="move">
-		<div class="field">
-			<label class="checkbox">
-				<input type="checkbox" name="${properties.name}" value="true" />
-				<sling:encode value="${properties.label}" mode="HTML" />
-			</label>
-		</div>
-		<div class="reference-list field">
-			<ul>
-				<c:forEach var="ref" items="${references.references}">
-					<li>${ref}</li>
-				</c:forEach>
-			</ul>
-		</div>
-		
-		<c:if test="${properties.includeDestination}">
-			<div class="field">
-				<label for=":dest">
-					Replacement Path
-				</label>
-				<div class="control">
-					<input type="text" name=":dest" class="pathfield input" />
-				</div>
-			</div>
-		</c:if>
-	</div>
+    <div class="field ${properties.toggle ? 'is-hidden toggle-value' : ''}" data-toggle-source=":operation" data-toggle-value="move">
+        <div class="field">
+            <label class="checkbox">
+                <input type="checkbox" name="${properties.name}" value="true" />
+                <sling:encode value="${properties.label}" mode="HTML" />
+            </label>
+        </div>
+        <div class="reference-list field">
+            <table class="table" data-paginate="false">
+                <thead>
+                    <tr>
+                        <th>Type</th>
+                        <th>Content</th>
+                        <th>Subpath</th>
+                        <th>Property</th>
+                </thead>
+                <tbody>
+                    <c:forEach var="ref" items="${references.references}">
+                        <tr>
+                            <c:choose>
+                                <c:when test="${ref.page}">
+                                    <td>
+                                        <span class="icon">
+                                            <span class="jam jam-document"></span>
+                                        </span>
+                                    </td>
+                                    <td title="${ref.containingPage.path}">
+                                        <a href="/cms/site/content.html${ref.containingPage.parent.path}">
+                                            ${sling:encode(ref.containingPage.title,'HTML')}
+                                        </a>
+                                    </td>
+                                    <td>
+                                        ${sling:encode(ref.subPath,'HTML')}
+                                    </td>
+                                    <td>
+                                        ${sling:encode(ref.property,'HTML')}
+                                    </td>
+                                </c:when>
+                                <c:otherwise>
+                                    <td>
+                                        <span class="icon">
+                                            <span class="jam jam-file"></span>
+                                        </span>
+                                    </td>
+                                    <td>
+                                        ${ref.resource.path}
+                                    </td>
+                                    <td>
+                                    </td>
+                                    <td>
+                                        ${sling:encode(ref.property,'HTML')}
+                                    </td>
+                                </c:otherwise>
+                            </c:choose>
+                        </tr>
+                    </c:forEach>
+                </tbody>
+            </table>
+        </div>
+        <c:if test="${properties.includeDestination}">
+            <div class="field">
+                <label for=":dest">
+                    Replacement Path
+                </label>
+                <div class="control">
+                    <input type="text" name=":dest" class="pathfield input" />
+                </div>
+            </div>
+        </c:if>
+    </div>
 </c:if>
\ No newline at end of file
diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/list.json b/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/list.json
index 7dab1db..2604694 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/list.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/list.json
@@ -83,6 +83,13 @@
                                     "icon": "cog",
                                     "prefix": "/cms/config/metadata.html"
                                 },
+                                "references": {
+                                    "jcr:primaryType": "nt:unstructured",
+                                    "modal": true,
+                                    "title": "References",
+                                    "icon": "directions",
+                                    "prefix": "/cms/shared/references.html"
+                                },
                                 "movecopy": {
                                     "jcr:primaryType": "nt:unstructured",
                                     "modal": true,
@@ -130,6 +137,13 @@
                                     "icon": "cog",
                                     "prefix": "/cms/folder/edit.html"
                                 },
+                                "references": {
+                                    "jcr:primaryType": "nt:unstructured",
+                                    "modal": true,
+                                    "title": "References",
+                                    "icon": "directions",
+                                    "prefix": "/cms/shared/references.html"
+                                },
                                 "movecopy": {
                                     "jcr:primaryType": "nt:unstructured",
                                     "modal": true,
diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/content/page/edit.json b/ui/src/main/resources/jcr_root/libs/sling-cms/content/page/edit.json
index a0ff169..af50c6c 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/page/edit.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/page/edit.json
@@ -28,13 +28,12 @@
                         "icon": "info",
                         "prefix": "/cms/shared/insights.html"
                     },
-                    "version": {
+                    "references": {
                         "jcr:primaryType": "nt:unstructured",
-                        "ajaxPath": ".versionmanager",
                         "modal": true,
-                        "title": "Manage Versions",
-                        "icon": "history",
-                        "prefix": "/cms/shared/versions.html"
+                        "title": "References",
+                        "icon": "directions",
+                        "prefix": "/cms/shared/references.html"
                     },
                     "movecopy": {
                         "jcr:primaryType": "nt:unstructured",
@@ -43,6 +42,14 @@
                         "icon": "move-alt",
                         "prefix": "/cms/shared/movecopy.html"
                     },
+                    "version": {
+                        "jcr:primaryType": "nt:unstructured",
+                        "ajaxPath": ".versionmanager",
+                        "modal": true,
+                        "title": "Manage Versions",
+                        "icon": "history",
+                        "prefix": "/cms/shared/versions.html"
+                    },
                     "delete": {
                         "jcr:primaryType": "nt:unstructured",
                         "modal": true,
diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/content/shared/references.json b/ui/src/main/resources/jcr_root/libs/sling-cms/content/shared/references.json
index 100d492..5d97060 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/shared/references.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/shared/references.json
@@ -9,7 +9,7 @@
             "sling:resourceType": "sling-cms/components/general/container",
             "references": {
                 "jcr:primaryType": "nt:unstructured",
-                "sling:resourceType": "sling-cms/components/editor/fields/references",
+                "sling:resourceType": "sling-cms/components/cms/references",
                 "label": "References"
             }
         }
diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/content.json b/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/content.json
index eae063e..9ed8e82 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/content.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/content.json
@@ -121,6 +121,13 @@
                                     "icon": "info",
                                     "prefix": "/cms/shared/insights.html"
                                 },
+                                "references": {
+                                    "jcr:primaryType": "nt:unstructured",
+                                    "modal": true,
+                                    "title": "References",
+                                    "icon": "directions",
+                                    "prefix": "/cms/shared/references.html"
+                                },
                                 "movecopy": {
                                     "jcr:primaryType": "nt:unstructured",
                                     "modal": true,
@@ -185,6 +192,13 @@
                                     "title": "Download file",
                                     "icon": "download"
                                 },
+                                "references": {
+                                    "jcr:primaryType": "nt:unstructured",
+                                    "modal": true,
+                                    "title": "References",
+                                    "icon": "directions",
+                                    "prefix": "/cms/shared/references.html"
+                                },
                                 "movecopy": {
                                     "jcr:primaryType": "nt:unstructured",
                                     "modal": true,
@@ -254,13 +268,6 @@
                                     "title": "Download file",
                                     "icon": "download"
                                 },
-                                "movecopy": {
-                                    "jcr:primaryType": "nt:unstructured",
-                                    "modal": true,
-                                    "title": "Move / Copy File",
-                                    "icon": "move-alt",
-                                    "prefix": "/cms/shared/movecopy.html"
-                                },
                                 "references": {
                                     "jcr:primaryType": "nt:unstructured",
                                     "modal": true,
@@ -268,6 +275,13 @@
                                     "icon": "directions",
                                     "prefix": "/cms/shared/references.html"
                                 },
+                                "movecopy": {
+                                    "jcr:primaryType": "nt:unstructured",
+                                    "modal": true,
+                                    "title": "Move / Copy File",
+                                    "icon": "move-alt",
+                                    "prefix": "/cms/shared/movecopy.html"
+                                },
                                 "version": {
                                     "jcr:primaryType": "nt:unstructured",
                                     "ajaxPath": ".versionmanager",
@@ -326,6 +340,13 @@
                                     "icon": "cog",
                                     "prefix": "/cms/folder/edit.html"
                                 },
+                                "references": {
+                                    "jcr:primaryType": "nt:unstructured",
+                                    "modal": true,
+                                    "title": "References",
+                                    "icon": "directions",
+                                    "prefix": "/cms/shared/references.html"
+                                },
                                 "movecopy": {
                                     "jcr:primaryType": "nt:unstructured",
                                     "modal": true,
@@ -383,6 +404,13 @@
                                     "icon": "cog",
                                     "prefix": "/cms/folder/edit.html"
                                 },
+                                "references": {
+                                    "jcr:primaryType": "nt:unstructured",
+                                    "modal": true,
+                                    "title": "References",
+                                    "icon": "directions",
+                                    "prefix": "/cms/shared/references.html"
+                                },
                                 "movecopy": {
                                     "jcr:primaryType": "nt:unstructured",
                                     "modal": true,
diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/content/siteconfig/editor.json b/ui/src/main/resources/jcr_root/libs/sling-cms/content/siteconfig/editor.json
index 49ce2d8..e879931 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/siteconfig/editor.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/siteconfig/editor.json
@@ -1,94 +1,101 @@
 {
-	"jcr:primaryType": "nt:unstructured",
-	"sling:resourceType": "sling-cms/components/general/container",
-	"richtext": {
-		"jcr:primaryType": "nt:unstructured",
-		"sling:resourceType": "sling-cms/components/general/richtext",
-		"text": "<br/><h3>Templates</h3>"
-	},
-	"contentactions": {
-		"jcr:primaryType": "nt:unstructured",
-		"sling:resourceType": "sling-cms/components/cms/contentactions",
-		"actions": {
-			"template": {
-				"jcr:primaryType": "nt:unstructured",
-				"label": "Template",
-				"prefix": "/cms/template/create.html"
-			}
-		}
-	},
-	"contenttable": {
-		"jcr:primaryType": "nt:unstructured",
-		"sling:resourceType": "sling-cms/components/cms/contenttable",
-		"appendSuffix": "/templates",
-		"columns": {
-			"jcr:primaryType": "nt:unstructured",
-			"name": {
-				"jcr:primaryType": "nt:unstructured",
-				"title": "Name"
-			},
-			"title": {
-				"jcr:primaryType": "nt:unstructured",
-				"title": "Title"
-			},
-			"lastModified": {
-				"jcr:primaryType": "nt:unstructured",
-				"title": "Last Modified"
-			},
-			"actions": {
-				"jcr:primaryType": "nt:unstructured",
-				"title": "Actions"
-			}
-		},
-		"types": {
-			"jcr:primaryType": "nt:unstructured",
-			"nt:unstructured": {
-				"jcr:primaryType": "nt:unstructured",
-				"columns": {
-					"jcr:primaryType": "nt:unstructured",
-					"name": {
-						"jcr:primaryType": "nt:unstructured",
-						"sling:resourceType": "sling-cms/components/cms/columns/name",
-						"link": false
-					},
-					"title": {
-						"jcr:primaryType": "nt:unstructured",
-						"sling:resourceType": "sling-cms/components/cms/columns/text",
-						"property": "jcr:title"
-					},
-					"lastModified": {
-						"jcr:primaryType": "nt:unstructured",
-						"sling:resourceType": "sling-cms/components/cms/columns/lastmodified",
-						"subPath": ""
-					},
-					"actions": {
-						"jcr:primaryType": "nt:unstructured",
-						"sling:resourceType": "sling-cms/components/cms/columns/actions",
-						"edit": {
-							"jcr:primaryType": "nt:unstructured",
-							"modal": false,
-							"new": false,
-							"title": "Edit Template",
-							"icon": "pencil-f",
-							"prefix": "/cms/template/edit.html"
-						},
-						"movecopy": {
-							"jcr:primaryType": "nt:unstructured",
-							"modal": true,
-							"title": "Move / Copy Template",
-							"icon": "move-alt",
-							"prefix": "/cms/shared/movecopy.html"
-						},
-						"delete": {
-							"jcr:primaryType": "nt:unstructured",
-							"modal": true,
-							"title": "Delete Template",
-							"icon": "trash",
-							"prefix": "/cms/shared/delete.html"
-						}
-					}
-				}
-			}
-		}
-	}
+    "jcr:primaryType": "nt:unstructured",
+    "sling:resourceType": "sling-cms/components/general/container",
+    "richtext": {
+        "jcr:primaryType": "nt:unstructured",
+        "sling:resourceType": "sling-cms/components/general/richtext",
+        "text": "<br/><h3>Templates</h3>"
+    },
+    "contentactions": {
+        "jcr:primaryType": "nt:unstructured",
+        "sling:resourceType": "sling-cms/components/cms/contentactions",
+        "actions": {
+            "template": {
+                "jcr:primaryType": "nt:unstructured",
+                "label": "Template",
+                "prefix": "/cms/template/create.html"
+            }
+        }
+    },
+    "contenttable": {
+        "jcr:primaryType": "nt:unstructured",
+        "sling:resourceType": "sling-cms/components/cms/contenttable",
+        "appendSuffix": "/templates",
+        "columns": {
+            "jcr:primaryType": "nt:unstructured",
+            "name": {
+                "jcr:primaryType": "nt:unstructured",
+                "title": "Name"
+            },
+            "title": {
+                "jcr:primaryType": "nt:unstructured",
+                "title": "Title"
+            },
+            "lastModified": {
+                "jcr:primaryType": "nt:unstructured",
+                "title": "Last Modified"
+            },
+            "actions": {
+                "jcr:primaryType": "nt:unstructured",
+                "title": "Actions"
+            }
+        },
+        "types": {
+            "jcr:primaryType": "nt:unstructured",
+            "nt:unstructured": {
+                "jcr:primaryType": "nt:unstructured",
+                "columns": {
+                    "jcr:primaryType": "nt:unstructured",
+                    "name": {
+                        "jcr:primaryType": "nt:unstructured",
+                        "sling:resourceType": "sling-cms/components/cms/columns/name",
+                        "link": false
+                    },
+                    "title": {
+                        "jcr:primaryType": "nt:unstructured",
+                        "sling:resourceType": "sling-cms/components/cms/columns/text",
+                        "property": "jcr:title"
+                    },
+                    "lastModified": {
+                        "jcr:primaryType": "nt:unstructured",
+                        "sling:resourceType": "sling-cms/components/cms/columns/lastmodified",
+                        "subPath": ""
+                    },
+                    "actions": {
+                        "jcr:primaryType": "nt:unstructured",
+                        "sling:resourceType": "sling-cms/components/cms/columns/actions",
+                        "edit": {
+                            "jcr:primaryType": "nt:unstructured",
+                            "modal": false,
+                            "new": false,
+                            "title": "Edit Template",
+                            "icon": "pencil-f",
+                            "prefix": "/cms/template/edit.html"
+                        },
+                    "references": {
+                        "jcr:primaryType": "nt:unstructured",
+                        "modal": true,
+                        "title": "References",
+                        "icon": "directions",
+                        "prefix": "/cms/shared/references.html"
+                    },
+                        "movecopy": {
+                            "jcr:primaryType": "nt:unstructured",
+                            "modal": true,
+                            "title": "Move / Copy Template",
+                            "icon": "move-alt",
+                            "prefix": "/cms/shared/movecopy.html"
+                        },
+                        "delete": {
+                            "jcr:primaryType": "nt:unstructured",
+                            "modal": true,
+                            "title": "Delete Template",
+                            "icon": "trash",
+                            "prefix": "/cms/shared/delete.html"
+                        }
+                    }
+                }
+            }
+        }
+    }
 }
\ No newline at end of file
diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/content/static/content.json b/ui/src/main/resources/jcr_root/libs/sling-cms/content/static/content.json
index a38146c..3f2a07b 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/static/content.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/static/content.json
@@ -121,6 +121,13 @@
                                     "icon": "move-alt",
                                     "prefix": "/cms/shared/movecopy.html"
                                 },
+                                "references": {
+                                    "jcr:primaryType": "nt:unstructured",
+                                    "modal": true,
+                                    "title": "References",
+                                    "icon": "directions",
+                                    "prefix": "/cms/shared/references.html"
+                                },
                                 "version": {
                                     "jcr:primaryType": "nt:unstructured",
                                     "ajaxPath": ".versionmanager",
@@ -178,6 +185,13 @@
                                     "title": "Download file",
                                     "icon": "download"
                                 },
+                                "references": {
+                                    "jcr:primaryType": "nt:unstructured",
+                                    "modal": true,
+                                    "title": "References",
+                                    "icon": "directions",
+                                    "prefix": "/cms/shared/references.html"
+                                },
                                 "movecopy": {
                                     "jcr:primaryType": "nt:unstructured",
                                     "modal": true,
@@ -235,6 +249,13 @@
                                     "icon": "cog",
                                     "prefix": "/cms/folder/edit.html"
                                 },
+                                "references": {
+                                    "jcr:primaryType": "nt:unstructured",
+                                    "modal": true,
+                                    "title": "References",
+                                    "icon": "directions",
+                                    "prefix": "/cms/shared/references.html"
+                                },
                                 "movecopy": {
                                     "jcr:primaryType": "nt:unstructured",
                                     "modal": true,
@@ -292,6 +313,13 @@
                                     "icon": "cog",
                                     "prefix": "/cms/folder/edit.html"
                                 },
+                                "references": {
+                                    "jcr:primaryType": "nt:unstructured",
+                                    "modal": true,
+                                    "title": "References",
+                                    "icon": "directions",
+                                    "prefix": "/cms/shared/references.html"
+                                },
                                 "movecopy": {
                                     "jcr:primaryType": "nt:unstructured",
                                     "modal": true,
diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/list.json b/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/list.json
index 16d191a..fcc0aee 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/list.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/list.json
@@ -78,6 +78,13 @@
                                     "icon": "pencil-f",
                                     "prefix": "/cms/taxonomy/edit.html"
                                 },
+                                "references": {
+                                    "jcr:primaryType": "nt:unstructured",
+                                    "modal": true,
+                                    "title": "References",
+                                    "icon": "directions",
+                                    "prefix": "/cms/shared/references.html"
+                                },
                                 "movecopy": {
                                     "jcr:primaryType": "nt:unstructured",
                                     "modal": true,