【问题标题】:TYPO3 v6.1 TemplaVoila - add userFunc to specific template partTYPO3 v6.1 TemplaVoila - 将 userFunc 添加到特定模板部分
【发布时间】:2013-12-29 19:24:31
【问题描述】:

如何通过 TypoScript 以编程方式将通过 USER_INT 的单个页面中的 {content_left} 的内容替换为单个 PHP 内容。

<div class="container">
  <div class="header span-28">
    <f:format.raw>{header}</f:format.raw> 
  </div>
    <img class="logo" src="../fileadmin/logo.png" alt="logo">
    <a href="./"><img class="headerimg" src="../fileadmin/header_img.png" alt="headerimg"></a>
  <div class="menu span-28">
    <f:format.raw>{main_menu}</f:format.raw>
  </div>
  <div class="service span-28">
    <f:format.raw>{service_menu}</f:format.raw>
  </div>
  <div class="content span-6 append-1">
    <f:format.raw>{content_left}</f:format.raw>
  </div>
  <div class="content span-22 last">
    <f:format.raw>{content_right}</f:format.raw>
  </div>
  <div class="footer span-28 last">
    <f:format.raw>{footer}</f:format.raw>
  </div>
</div>

我目前的 TypoScript 看起来是这样的:

# 
temp.info = USER_INT
temp.info {
  userFunc = user_various->listContentRecordsOnPage
  reverseOrder = 1
  debugOutput = 1
}
page.content_left < temp.info

但它不起作用。 :( 没有更换。

感谢您的帮助。

干杯 kk3003


gsnerf 是绝对正确的,它是一个 FLUIDTEMPLATE 元素。 不幸的是,这个 TYPOSCRIPT 设置为它应该出现的单页不起作用,请问有什么想法吗?

# Include the PHP file with custom code
includeLibs.user_various = fileadmin/php/example_listRecords.php

# 
temp.info = USER_INT
temp.info {
  userFunc = user_various->listContentRecordsOnPage
}

page = PAGE
page {
   typeNum = 0

   metaCharset = utf-8

   includeCSS{
    file10  = fileadmin/css/blueprint/screen.css
    file20  = fileadmin/css/blueprint/print.css
    file20.media = print

    file100 = fileadmin/css/main.css
    file300 = fileadmin/css/service.css
    file400 = fileadmin/css/mainMenu.css
    file500 = fileadmin/css/sliding-box.css
    file600 = fileadmin/css/gridelements.css
   }

   includeJS {
        file10 = fileadmin/js/accordion.js
   }
}

[browser = msie]
page.includeCSS.file30 = fileadmin/css/blueprint/ie.css
page.includeCSS.file30.media = screen
[global]

page.meta {
  MSSmartTagsPreventParsing = true
  imagetoolbar  = false
}

# https_enforcer
page.5 < plugin.tx_httpsenforcer_pi1

# Create a Fluid Template
page.10 = FLUIDTEMPLATE
page.10 {
  # Set the Template Pathes
  file = fileadmin/templates/html/template.html
  partialRootPath = fileadmin/templates/html/partials/
  layoutRootPath = fileadmin/templates/html/layouts/
  variables {
    header < lib.header
    content_left < lib.contentLeft
    content_right < temp.info
    main_menu < lib.mainMenu
    service_menu < lib.serviceMenu
    footer < lib.footer
  }
}

谢谢

【问题讨论】:

    标签: typo3 typoscript fluid typo3-6.1.x


    【解决方案1】:

    我不确定这与 templavoila 有什么关系?这对我来说似乎更像流体。如果是这种情况,您必须更换您的

    page.content_left < temp.info
    

    以下内容:

    10 = FLUIDTEMPLATE
    10 {
        [...]
    
        variables.content_left < temp.info
    }
    

    假设您已经有一个 FLUIDTEMPLATE 定义,您只需将变量行复制到该定义中。

    【讨论】:

    • 您好 gsnerf,感谢您的回答。请看我上面的更新。谢谢!
    • 好的,知道了。我需要将这些内容包含在页面自己的子模板中。 ;) 我只是将它作为 TS 添加到页面中。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-29
    相关资源
    最近更新 更多