dongzhi4470 2018-11-29 12:26
浏览 33
已采纳

Typo3 FLUID和Bootstrap 4“卡组”

I am new to Fluid and Typo3 and trying to write my own template-extension based on Bootstrap 4. I like the cards of BS4 and added them as contentelement into my template-extension with no problem.

If I add content with my new card-contentelement now, I want this element and all other card-contentelements be wrapped into <div class="card-group> ... card div and other card-stuff ... </div> or better, I need the following structure:

<div class="card-group">
    <div class="card">
        CARD ONE
    </div>
</div>

<div class="container">
    OTHER CONTENT-ELEMENTS
</div>

<div class="card-group">
    <div class="card">
        CARD TWO
    </div>

    <div class="card">
        CARD THREE
    </div>
</div>

As you can see, I want to be one or more card-content-elements to be wrapped into a "card-group" div.

But I don't know how to do this within my layout, template nor typoscript. The only result I get is, that every card is wrapped in its own "card-group" div. =(

Any ideas? I am going nuts, sitting couple hours for a solution. Thanks in advance,

Chris

  • 写回答

1条回答 默认 最新

  • duanbi1888 2018-11-29 13:30
    关注

    Any content element (CE) does know nothing about other CEs.
    As a result each CE can only wrap itself.

    If you want a wrap around multiple CEs you either have to build a container or do nasty things in javascript.

    last one first:
    you have to analyze the HTML-source end remove the wrapping between adjacent cards. As this easily can go wrong I would not realize it. You need to remove a </div><div class="card-group"> where the closing div also needs to be a class card-group. very difficult to identify!


    As Phillip suggested: there are multiple solutions to use container-CEs in TYPO3.
    The container CE will do the outside wrap (<div class="card-group">|</div>).
    The contained CEs do the subrendering (<div class="card">|</div>)

    Container CEs could be defined easily with EXT:gridelements, EXT:mask, ...


    Another way of container would be a "page column". here the drawback is a very static layout. A markup like your example would need two reserved columns for cards.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题