Skript: 12.7a0df29316b3b3d811cd58f6
displayName: String Skript
engine: String nashorn
javascript: String var nodeIteratorUtil = require("NodeIteratorUtil"); var propertyUtil = require("PropertyUtil"); var linkRenderer = require("LinkRenderer"); var outputUtil = require("OutputUtil"); var sidePage = scriptVariables.sidePage; var mainStartNode = scriptVariables.mainStartNode; var mainPages = nodeIteratorUtil.getMenuItems(mainStartNode); var oldJvPage = scriptVariables.oldJvPage; var oldJvPageContent = scriptVariables.oldJvPage; var pageHeader = scriptVariables.pageHeader; linkRenderer.setFontClass("jor-page-navigation__link"); var heading = ""; var html = ''; //html += '<div class="jor-linkblock-container">'; /* var heading = propertyUtil.getString(sidePage, pageHeader); var contentArea = sidePage.getNode('Page Content/Mittenspalt');  var content = outputUtil.getNodeOutput(sidePage, contentArea, outputUtil.CONTENT_TYPE_TEXT_HTML); html += '<div class="jor-linkblock-servicelinks jor-set-font-color_white">'; html += '<h2 class="subheading">' + heading + '</h2>'; html += '<div>' + content + '</div>'; html += '</div>'; */ html += '<div class="jor-linkblock-mainlinks-wrapper">'; html += '<h2 class="jor-linkblock-mainlinks-heading">På nya jordbruksverket.se:</h2>'; addNavigation (mainPages, "jor-linkblock-mainlinks"); if (oldJvPage) { html += '<h2 class="jor-linkblock-mainlinks-heading">På gamla jordbruksverket.se:</h2>'; var contentArea = oldJvPage.getNode('Page Content/Mittenspalt');  var content = outputUtil.getNodeOutput(oldJvPage, contentArea, outputUtil.CONTENT_TYPE_TEXT_HTML); html += '<div class="jor-linkblock-secondarylinks">'; html += '<div>' + content + '</div>'; html += '</div>'; } html += '</div>'; //html += '</div>'; function addNavigation (pages, navClass) { html += '<nav class="' + navClass + '">'; while (pages.hasNext()) { page = pages.nextNode(); heading = propertyUtil.getString(page, pageHeader); var link = propertyUtil.getNode(page, "pageLink"); if (link) { linkRenderer.update(link, heading); } var contentArea = page.getNode('Page Content/Mittenspalt');  var content = outputUtil.getNodeOutput(page, contentArea, outputUtil.CONTENT_TYPE_TEXT_HTML); html += '<div class="jor-linkblock-mainlinks-item">'; if (link) { html += linkRenderer.render(); } else { html += '<h2 class="subheading">' + heading + '</h2>'; } html += '<div>' + content + '</div>'; html += '</div>'; } html += '</nav>'; }
javascriptFileIsTrashed: String false
javascriptSource: String script
jcr:mixinTypes: MultiValue [mix:referenceable]
jcr:primaryType: Name sv:portlet
jcr:uuid: String 12.7a0df29316b3b3d811cd58f6
nativeObjectsByDefault: String true
portletName: String script
scriptReferences: MultiValue [senselogic.sitevision.scripting.reference.ScriptingReference@44e77ddf,
senselogic.sitevision.scripting.reference.ScriptingReference@366af12e,
senselogic.sitevision.scripting.reference.ScriptingReference@330ed458,
senselogic.sitevision.scripting.reference.ScriptingReference@167ed87e]
showOffline: Boolean true
useNativeObjects: Boolean true
velocity: String $html
velocityFileIsTrashed: String false
velocitySource: String script