Project

General

Profile

Actions

Feature #23853

closed

Array in FLUIDTEMPLATE

Added by Stefan Froemken about 14 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-10-27
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

Description

My TS:

page.100 = FLUIDTEMPLATE
page.100 {
  file = fileadmin/templates/fluid.html
  variables {
    myName = TEXT
    myName.value = Stefan Frömken

    customer = CONTENT
    customer {
      select {
        pidInList = 8
      }
      returnArray = 1 (This could be a new option)
      table = fe_users
    }
  }
}

My Template:
<html> <head> <title>FLUID-Template</title> </head> <body> <p>Hello: {myName}</p> <p>This are my customers</p> <ul> <f:for each="{customer}" as="daten"> <li>{daten.firstname} {daten.lastname}</li> </f:for> </ul> </body> </html>

Maybe there is a possibility to return Arrays in some cObjects.
(issue imported from #M16144)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #43182: Split FLUIDTEMPLATE class to smaller methodsClosed2012-11-20

Actions
Actions #1

Updated by Ernesto Baschny almost 14 years ago

Nice idea, but will have to be postponed to 4.6. Thanks!

Actions #2

Updated by Stefan Froemken almost 14 years ago

no problem. I read in TYPO3-lists that there is less time and much to do to get 4.5 very cool :-)

Actions #3

Updated by Xavier Perseguers over 13 years ago

  • Category deleted (Communication)
  • Target version deleted (4.6.0-beta1)
Actions #4

Updated by Christian Kuhn about 12 years ago

I have a similar issue:

if you have some TS like that for a extbase plugin:

plugin.tx_foo {
  persistence{
    ...
  }
  settings {
    foo = bar
    foobar.test = {$some constant}
  }
}

then, the extbase action controller assigns settings to the view automatically, it is available in fluid as {settings}. This feature is extremely useful!

I suggest to add a new setting to FLUIDTEMPLATE that does the same:

foo = FLUIDTEMPLATE {
  partialRootPath = {...}
  layoutRootPath = {...}
  variables {
    aCObj = TEXT
    aCObj.value = some text
    ...
  }
  settings {
    foo = bar
  }
}

Actions #5

Updated by Gerrit Code Review almost 12 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17849

Actions #6

Updated by Gerrit Code Review almost 12 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17849

Actions #7

Updated by Gerrit Code Review almost 12 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17849

Actions #8

Updated by Christian Kuhn almost 12 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #9

Updated by Eric Depta about 11 years ago

  • % Done changed from 100 to 0

What is that settings thing?
For me it looks like completly failed!
What about things like this:

page.100 = FLUIDTEMPLATE
page.100 {
file = fileadmin/templates/fluid.html
variables {
array {
0 < styles.content.get
1 < styles.content.getLeft
}
}
}

Template:

<f:for each="{array}" as="col">
<div class="col">{col}</div>
</f:for>

Also returning selects as array would be cool as suggested.

sorry cant fix the script layout...

Actions #10

Updated by Stefan Neufeind over 10 years ago

@Eric: If you use "variables" everything is based on objects. For example you'll have to define a TEXT-object to pass through text to a Fluid-template. And all that you pass through to Fluid here is evaluated, there are no "values" passed or so. Fluid gets the final, generated output (text).
With "settings" you can pass through certain values unmodified and without any evaluation. This way you could for example pass

settings.person {
name = foo
pictureUrl = bar
}

through to Fluid and there decide about the output. You could use the pictureUrl (just a "string") to pass that as src to a f:image-ViewHelper.

Actions #11

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF