{# N.b. see https://symfony.com/blog/better-white-space-control-in-twig-templates for what the -s and ~s are used for. #} {# Required to use Twig functions #} {%~ import _self as self %} {%~ macro featureImageOnClickEvent(menuNodeId) %} if (!window.zenarioA) return true; if (zenarioA.pageMode == 'menu') { zenarioAB.open('zenario_menu', {'mID':'{{menuNodeId}}'}, 'feature_image'); return false; } {%~ endmacro %} {%~ macro addOnMouseOver(containerId, currentLevelNodeId, topLevelNodeId, menuNodeHasOwnFeatureImage) %} {# This line must be included again if a function calls another function. #} {%~ import _self as self %} {# Define variables to avoid having to use quotes later #} {%~ set topLevelId = topLevelNodeId['id'] %} {%~ set topLevelTitle = topLevelNodeId['title'] %} {%~ set topLevelText = topLevelNodeId['text'] %} {%~ set currentLevelId = currentLevelNodeId['id'] %} {%~ set currentLevelImageLink = currentLevelNodeId['feature_image_link'] %} {%~ set currentLevelImageSrcset = currentLevelNodeId['Image_Srcset'] %} {%~ set currentLevelImageWidth = currentLevelNodeId['feature_image_width'] %} {%~ set currentLevelImageHeight = currentLevelNodeId['feature_image_height'] %} {%~ set currentLevelDestUrl = currentLevelNodeId['dest_url'] %} {%~ set currentLevelTitle = (currentLevelNodeId['title'] ? currentLevelNodeId['title'] : ' ') %} {%~ set currentLevelText = (currentLevelNodeId['text'] ? currentLevelNodeId['text'] : '
 
') %} {%~ set currentLevelLinkType = currentLevelNodeId['link_type'] %} onmouseover=" {# Title/description fallback logic: use the parent node details #} {%~ set title = (topLevelTitle ? topLevelTitle|e('js') : " ") %} {%~ set desc = (topLevelText ? topLevelText|e('js') : " ") %} $('#{{containerId}} .feature_title').html('