kk3003
kk3003

Reputation: 43

TYPO3 v6.1 TemplaVoila - add userFunc to specific template part

how can I replace programmatically via TypoScript the content of {content_left} in a single page via USER_INT with individual PHP content.

<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>

My current TypoScript does look like this:

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

But it does not work. :( No replacement is done.

Thanks for any help.

Cheers kk3003


gsnerf is absolutety right, it's a FLUIDTEMPLATE element. Unfortunately this TYPOSCRIPT set to the single page where it should appear does not work, any ideas please?

# 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
  }
}

Thanks

Upvotes: 0

Views: 713

Answers (1)

gsnerf
gsnerf

Reputation: 572

I'm not sure what this is supposed to have to do with templavoila? This seems more like fluid to me. If that is the case you have to replace your

page.content_left < temp.info

with the following:

10 = FLUIDTEMPLATE
10 {
    [...]

    variables.content_left < temp.info
}

Assuming you already have a FLUIDTEMPLATE definition you only need to copy the variables line into that one.

Upvotes: 1

Related Questions