<% Resource titleRes = resource.getChild("title"); Resource breadcrumbs = resource.getChild("breadcrumbs"); if (titleRes != null || breadcrumbs != null || rails != null) { %> <% if (breadcrumbs != null) { List crumbs = IteratorUtils.toList(cmp.asDataSource(breadcrumbs).iterator()); if (!crumbs.isEmpty()) { %><% for (int j = 0; j < crumbs.size(); j++) { Resource item = (Resource) crumbs.get(j); Config itemCfg = new Config(item); AttrBuilder itemAttrs = new AttrBuilder(request, xssAPI); String navigatorCollectionid = itemCfg.get("path", String.class); if (navigatorCollectionid != null) { itemAttrs.add("data-granite-collection-navigator-collectionid", navigatorCollectionid); } else { itemAttrs.add("data-granite-collection-navigator-href", itemCfg.get("href", String.class)); } %>><%= xssAPI.encodeForHTML(itemCfg.get("title")) %><% } %><% } } else { if (titleRes != null) { %><% } } %> <% if (rails != null) { %> <%= xssAPI.encodeForHTML(i18n.get("Content Only")) %><% // we map all rail items to the numbers in the keyboard using control + {index} int railItemIndex = 1; for (Iterator it = rails.listChildren(); it.hasNext(); railItemIndex++) { Resource item = it.next(); if (cmp.getRenderCondition(item, true).check()) { Config itemCfg = new Config(item); AttrBuilder itemAttrs = new AttrBuilder(request, xssAPI); // we stop once we reach 9 since all available numbers have been used if (railItemIndex < 10) { itemAttrs.add("data-foundation-command", "alt+" + railItemIndex); } if (item.getName().equals("omnisearchfilter")) { itemAttrs.add("data-granite-toggleable-control-action", "hide"); itemAttrs.add("data-granite-toggleable-control-target", "#shell-collectionpage-rail"); itemAttrs.add("data-granite-omnisearch-filter", ""); } else { String href = ex.getString(itemCfg.get("href", String.class)); itemAttrs.add("icon", itemCfg.get("icon", String.class)); if (href != null) { itemAttrs.add("data-granite-toggleable-control-action", "navigate"); itemAttrs.addHref("data-granite-toggleable-control-href", href); } else { String railPanelTarget = ".shell-collectionpage-rail-panel[data-shell-collectionpage-rail-panel='" + item.getName() + "']"; itemAttrs.add("data-granite-toggleable-control-action", "show"); itemAttrs.add("data-granite-toggleable-control-target", railPanelTarget); } itemAttrs.addSelected(itemCfg.get("active", false)); if (!hasActiveRail && savedRailTarget != null && savedRailTarget.equals(item.getName())) { itemAttrs.addSelected(true); savedRailTargetFound = true; } } %>><%= outVar(xssAPI, i18n, itemCfg.get("jcr:title", String.class)) %><% } } %><% } Resource primary = resource.getChild("actions/primary"); if (primary != null) { for (Iterator it = primary.listChildren(); it.hasNext();) { %><% } } %> <% Resource secondary = resource.getChild("actions/secondary"); if (secondary != null) { for (Iterator it = secondary.listChildren(); it.hasNext();) { %><% } } %> <% } %>
<% if (rails != null) { AttrBuilder railAttrs = new AttrBuilder(request, xssAPI); railAttrs.add("id", "shell-page-rail"); railAttrs.addClass("foundation-toggleable foundation-layout-panel-rail granite-rail"); railAttrs.addClass("foundation-container-resizable"); railAttrs.add("data-granite-layout-panel-save-key", panelWidthSaveKey); railAttrs.add("data-granite-layout-panel-min-width", minRailSize); String panelStyle = ""; if (savedPanelWidth != null && !savedPanelWidth.isEmpty()) { panelStyle = "width: " + savedPanelWidth + "px;"; } if (cmp.getExpressionHelper().getBoolean(rails.getValueMap().get("active", "false")) || savedRailTargetFound) { railAttrs.addClass("foundation-layout-panel-rail-active"); railAttrs.addClass("foundation-layout-panel-rail-activate-panel"); } else { if (savedPanelWidth != null && !savedPanelWidth.isEmpty()) { panelStyle = panelStyle + "margin-left: -" + savedPanelWidth + "px;"; } } railAttrs.add("style", panelStyle); %>
> <% for (Iterator it = rails.listChildren(); it.hasNext();) { Resource item = it.next(); AttrBuilder itemAttrs = new AttrBuilder(request, xssAPI); itemAttrs.addClass("shell-collectionpage-rail-panel"); itemAttrs.add("data-shell-collectionpage-rail-panel", item.getName()); if (!hasActiveRail && savedRailTarget != null && savedRailTarget.equals(item.getName())) { itemAttrs.addSelected(true); } cmp.include(item, new Tag(itemAttrs)); } %>
<% } AttrBuilder panelContentAttrs = new AttrBuilder(request, xssAPI); panelContentAttrs.add("data-granite-layout-content-min-width", minContentSize); %>
><% Resource content = resource.getChild("content"); if (content != null) { %><% } %>