更新内容菜单以在单击时打开,而不是悬停时打开
当用户悬停于包含 IBM® Web Content Manager 项的 Portlet 时,会打开内容菜单。在 组合累积修订 05 中,您可以将内容菜单设置为在用户单击 Portlet 外表中的图标时打开,而不是悬停于 Portlet 上时打开。
关于此任务
过程
- 将内容菜单图标添加到您的定制外表中。更新定制主题 CSS 精灵以包含新内容菜单图标图像。将 master.png 静态资源替换为位于以下位置的 WebDAV 中的 Portal 8.5 缺省主题图像:/themes/Portal8.5/css/images/master.png。
- 将图标 HTML 添加到定制外表中。将以下代码添加到定制外表模板中,位于 <h2> 节点之后。
<a aria-haspopup="true" aria-label="Display component action menu" role="button" href="javascript:;" class="wpthemeIcon wpthemeMenuFocus contextMenuInSkinIcon" style="display:none" tabindex="0"> <span title="Display component action menu"><img aria-label="Display component action menu" alt="" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"></span> <span class="wpthemeAltText">Component Action Menu</span> <!-- start CAM template --> <span class="wpthemeMenu" data-positioning-handler="horizontallyCenteredBelow"> <div class="wpthemeMenuBorder"> <!-- define the menu item template inside the "ul" element. only "css-class", "description", and "title" are handled by the theme's sample javascript. --> <ul class="wpthemeMenuDropDown wpthemeTemplateMenu" role="menu"> <li class="${css-class}" role="menuitem" tabindex="-1"><span class="wpthemeMenuText">${title}</span></li> </ul> <div class="verticalMenuPointer pointer"></div> </div> <!-- Template for loading --> <div class="wpthemeMenuLoading wpthemeTemplateLoading">${loading}</div> <!-- Template for submenu --> <div class="wpthemeAnchorSubmenu wpthemeTemplateSubmenu"> <div class="wpthemeMenuBorder wpthemeMenuSubmenu"> <ul id="${submenu-id}" class="wpthemeMenuDropDown" role="menu"> <li role="menuitem" tabindex="-1"></li> </ul> </div> </div> </span> <!-- end CAM template --> </a> - 转换 aria-label 和 wpthemeAltText 的值以支持您支持的任何语言。
- 为图标添加 CSS。在定制主题中任意位置添加以下代码。
.wpthemeControlHeader a.wpthemeIcon.contextMenuInSkinIcon img { background-position:0 -1496px; } - 将新内容菜单添加到定制主题概要文件中。打开主题概要文件,然后将 wp_skin_cam 添加到 deferredModuleIDs 部分中。