简体   繁体   English

如何使用WCM菜单/导航组件创建如下所示的嵌套HTML结构?

[英]How to create a nested HTML structure shown below using WCM Menu/Nav component?

I am designing a carousel with three images. 我正在设计带有三个图像的轮播。 I need to implment following code using WCM. 我需要使用WCM实现以下代码。 I am able to design with a single result design. 我可以使用单个结果设计进行设计。 Please guide me how to get three links in a set. 请指导我如何获取一组链接。 All the images are in the same site area. 所有图像都在同一站点区域中。

<div class="subBox">
    <div class="set">
        <div class="images"><img src='slide1.jpg' alt='' /></div>
        <div class="images"><img src='slide2.jpg' alt='' /></div>
        <div class="images"><img src='slide3.jpg' alt='' /></div>
    </div>
    <div class="set">
        <div class="images"><img src='slide4.jpg' alt='' /></div>
        <div class="images"><img src='slide5.jpg' alt='' /></div>
        <div class="images"><img src='slide6.jpg' alt='' /></div>
    </div>
    <div class="set">
        <div class="images"><img src='slide7.jpg' alt='' /></div>
        <div class="images"><img src='slide8.jpg' alt='' /></div>
        <div class="images"><img src='slide9.jpg' alt='' /></div>
    </div>
</div>

Use a List Presentation in a Menu / Navigator - depending on whether you need to preserve the order. 在菜单/导航器中使用列表演示-取决于是否需要保留订单。 Set the maximum number of 9. 设置最大数量为9。

Header: 标头:

<div class="subBox">
  <div class="set">

Item Layout: 项目布局:

[Plugin:Matches pattern="(3|6)" text="[Placeholder tag='listnum']"]
  </div>
  <div class="set">
[/Plugin:Matches]
    <div class="images">[Element type="content" context="autofill" key="img"]</div>

Footer: 页脚:

  </div>
</div>

So you have one sitearea under this sitearea there is a set of content . 因此,您在该站点 区域下有一个站点区域 ,其中包含一组 内容

There is nothing out of the box can do it for you. 开箱即用没有什么可以为您做的。

First Solution(Using Javascript) 第一个解决方案(使用Javascript)

  • render all Images in one hidden Div 在一个隐藏的Div中渲染所有图像
  • add some java script code to construct your HTML 添加一些Java脚本代码来构建HTML

Second solution(Creating Custom Plugin) 第二种解决方案(创建自定义插件)

  • Create custom plugin and pass to it index of the item and sublist items number and it only renders it's body if ("index" mod "Sublist items number" equal zero), you can get index from [Placeholder tag="listnum" htmlencode="false"] and in your case "Sublist items number" is 3 创建自定义插件并将其传递给项目子列表项目编号的 索引,并且只有在(“索引” mod“子列表项目编号”等于零)的情况下,它才能呈现其主体,您可以从[Placeholder tag =“ listnum” htmlencode = “ false”],在您的情况下,“子列表项编号”为3

  • In menu design header ="<div class="subBox"><div class="set">" in design for each result render your item then use your custom plugin to render " " -> will render every 3 items design for footer "</div></div>" 在菜单设计header ="<div class="subBox"><div class="set">"中,每个结果的设计header ="<div class="subBox"><div class="set">"渲染项目,然后使用自定义插件渲染“”->将为页脚渲染每3个项目设计"</div></div>"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM