Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typo3 在特定页面中以不同方式包装内容元素_Typo3_Typoscript - Fatal编程技术网

Typo3 在特定页面中以不同方式包装内容元素

Typo3 在特定页面中以不同方式包装内容元素,typo3,typoscript,Typo3,Typoscript,我的所有内容元素都使用stdWrap.wrap进行包装。 我正在寻找一种解决方案,将我的ke_search以不同方式添加的内容元素包装到页面中 为什么需要另一个HTML标记? 通常情况下,搜索结果周围会有另一个,这将使您能够通过CSS添加另一个样式 您的页面可能如下所示: <body> <div class="header"> : </div> <div class="content"> <div id="C1

我的所有内容元素都使用
stdWrap.wrap
进行包装。
我正在寻找一种解决方案,将我的
ke_search
以不同方式添加的内容元素包装到页面中

为什么需要另一个HTML标记?
通常情况下,搜索结果周围会有另一个
,这将使您能够通过CSS添加另一个样式

您的页面可能如下所示:

<body>
  <div class="header">
     :
  </div>
  <div class="content">
     <div id="C123">
        <h3>my very special CE</h3>
        <p class="bodytext">with some text to demonstrate.</p>
     </div>
     <div id="345">
        <h3>your search results:</h3>
        <div class="search-results">
           <a href="index.php?id=67&s=special">
              <div id="C123">
                 <h3>my very special CE</h3>
                 <p class="bodytext">with some text to demonstrate.</p>
              </div>
           </a>
           <a href="index.php?id=83&s=special">
              <div id="C52">
                 <h2>just a demo</h3>
                 <p class="bodytext">this text is nothing special.</p>
              </div>
           </a>
        </div>
    </div>
  </div>
</body>

我回答我自己的问题:

您可以使用以下打字脚本片段有条件地包装特定的内容元素

tt_content { 
       stdWrap { 
          if.value = tx_kesearch_pi2
                  {
                     wrap = | 
                     innerWrap > 
                  } 
         wrap = <div class="someotherclass">|</div>
              } 
         } 
tt_内容{
stdWrap{
if.value=tx\u kesearch\u pi2
{
包裹=|
innerWrap>
} 
包裹=|
} 
} 

我知道我可以使用css解决问题,但需求也是如此。我想在不同的元素上有不同的包装。我已经回答了我的问题,这不可能是你的答案,因为这是无效的打字稿。它肯定是无效的。答案显示了它是如何工作的,而不是一个可用于生产的代码。我已经将答案更新为有效代码(并删除了注释等),它对我来说绝对有效。它也可能帮助其他人。我的内容元素不需要deletional,而是用|包装的,我想在tx_kesearch_pi2内容元素上设置一个异常(我不想用任何东西包装它),上面的代码片段工作正常。如果你有更好的解决方案,请写下来。
tt_content { 
       stdWrap { 
          if.value = tx_kesearch_pi2
                  {
                     wrap = | 
                     innerWrap > 
                  } 
         wrap = <div class="someotherclass">|</div>
              } 
         }