0

我正在尝试制作一个简单的 2 列预告元素,该元素在左列显示图像,在右列显示内容元素以及按钮链接。

这是原始的 ts,它可以工作,但它很丑,而且图像是静态的:


tt_content.gridelements_pi1.20.10.setup {
        29 < lib.gridelements.defaultGridSetup
        29 {
        columns {
            20 < .default
            20.outerWrap = <div class="fifty1"><div class="csc-textpic csc-textpic-intext-left-nowrap"><div class="csc-textpic-imagewrap"><a href="index.php?id={field:flexform_link1}"><img src="{field:flexform_teaserimage1}" alt="" /></a></div></div><div class="fiftycontent"><div class="csc-textpic csc-textpic-text"><a href="index.php?id={field:flexform_link1}">|</a></div></div><div class="fiftylink"><a href="index.php?id={field:flexform_link1}"><img src="{$tmplpath}images/button.png" alt="" /></a></div></div>
                    20.insertData = 1 
                }
        }

}

这是我正在编码的新 ts,图像和按钮有效,但内容元素部分显示不正确:


tt_content.gridelements_pi1.20.10.setup {
        29 < lib.gridelements.defaultGridSetup
        29 {
        columns {
            20.prepend = COA
            20.prepend.20 = IMAGE
            20.prepend.20.file.import.field = flexform_teaserimage1
            20.insertData = 1           
                    20.prepend.20.stdWrap.typolink.parameter.field = flexform_link1
                    20.prepend.20.wrap  = <div class="csc-textpic csc-textpic-intext-left-nowrap"><div class="csc-textpic-imagewrap">|</div></div>

                    20.prepend.25 < .default 

                    20.prepend.25.outerWrap = <div class="fiftycontent"><div class="csc-textpic csc-textpic-text">|</div></div>
                    20.prepend.25.stdWrap.typolink.parameter.field = flexform_link1
            20.prepend.30 = IMAGE
            20.prepend.30.file = {$tmplpath}images/button.png
            20.prepend.30.stdWrap.typolink.parameter.field = flexform_link1
            20.prepend.30.wrap = <div class="fiftylink">|</div> 
            20.prepend.wrap = <div class="fifty1">|</div>

        }
        wrap = <div class="largeteaser">|</div>
        }

}

基本上我想要的只是 "20.prepend.25 < .default" 工作,我尝试了 "< tt_content" 或 "< lib.gridelements.defaultGridSetup.columns.default" ,结果有时很奇怪并且重复了许多内容。如何获得与添加 "< .default" 相同的行为?

4

1 回答 1

1

我明白了,我不确定这是否是最优雅的解决方案,但我使用 prepend/append 将 renderObj 夹在中间

        columns {
        20.outerWrap = <div class="fifty1">|</div>
        20.prepend = COA            
                    20.prepend {
                         20 = IMAGE
                         20.file.width = 386
                         20.file.height = 162 
             20.file.import.field = flexform_teaserimage1
                         20.stdWrap.typolink.parameter.field = flexform_link1
                         20.wrap  = <div class="csc-textpic csc-textpic-intext-left-nowrap"><div class="csc-textpic-imagewrap">|</div></div>
                    }

                    20.renderObj = COA
                    20.renderObj {
                         25 =< tt_content
                         wrap = <div class="fiftycontent"><div class="csc-textpic csc-textpic-text">|</div></div>
                         25.stdWrap.typolink.parameter.field = flexform_link1 
                    }

        20.append = COA         
                    20.append {
             30 = IMAGE
             30.file = {$tmplpath}images/button.png
             30.stdWrap.typolink.parameter.field = flexform_link1
             30.wrap = <div class="fiftylink">|</div> 
                    }

    }
于 2013-08-16T10:51:32.500 回答