Feature #38633

Feature #38629: Make TypoScript usable outside the context of TYPO3 / Nodes, but also for building extensible FLOW3 applications

Make TypoScript Context multi-valued

Added by Sebastian Kurfuerst about 3 years ago. Updated almost 3 years ago.

Status:Resolved Start date:2012-07-04
Priority:Should have Due date:
Assigned To:- % Done:

100%

Category:-
Target version:-

Description

Currently, the TypoScript context only contains a single value at a time, f.e. the current node being rendered.

It it always exposed as the "context" variable in Eel expressions inside TypoScript code.

However, when dealing with TYPO3CR nodes, it would be much nicer to rather have that variable called node or currentNode instead of context. Together with #38631 this makes it more clear to the user what's actually happening, as he would then write q(node) or even q(currentNode).

When working with arbitrary objects inside TypoScript, having only one object as the context seems to be a little too restrictive: Often, we need multiple objects on the stack, like the current blog or post. These should be made accessible then using ${post} and ${blog}, respectively.

This would also need a change inside the Collection TypoScript Object (as this is the only one changing the context): There, we need a variable specifying how the "inner context variable" should look like.

Furthermore, we might need to add a "context" array to all TypoScript Objects which can be used to manipulate the context objects


Related issues

blocks Foo.ContentManagement - Major Feature #37293: Refactor Admin to work inside Phoenix as Foo.ContentManag... New 2012-05-18

Associated revisions

Revision ba74758a
Added by Sebastian Kurfuerst almost 3 years ago

[!!!][FEATURE] Make TypoScript Context multi-valued; make FlowQuery use explicit

Before, the TypoScript context only contained a single value which was
available in the template as "context". Inside TypoScript Eel expressions, we
automatically wrapped the context object with FlowQuery; so "context" inside
eel expressions was a wrapped context.

Now, we're untangling this:

  • The TypoScript context can contain multiple named values, which are all
    directly available inside Eel expressions. So, if your context contains a
    variable "node", this is directly accessible inside Eel.
  • FlowQuery must be explicitly used, by calling the "q" function (short for
    "Query").
  • The hardcoded "context" variable inside Fluid templates has been removed; so
    all variables which should be available inside Fluid must be explicitly
    passed into the template.

In the context of Phoenix, before this change, one used f.e.
"context.property('title')". Now, he has to use "q(node).property('title')".

Backwards Compatibility =======================

Together with If043a53cb0556ca1d8e72ae05e269dcb8ee056f5, we are inserting a
backwards compatibility layer:

  • "context" inside Eel expression is the same as "q(node)", so this is the same
    behavior as before
  • "context" inside Fluid Templates is a reference to "node", as it was before.

Still, you should rewrite your templates as we will remove this compatibility
layer later on.

Note: We're merging two features as one change, as it is required in order to
provide backwards compatible behavior.

Resolves: #38631
Resolves: #38633
Change-Id: I5b1863510d372d953c7a076c03214295d4f1131b

History

#1 Updated by Sebastian Kurfuerst about 3 years ago

  • Tracker changed from Bug to Feature

#2 Updated by Gerrit Code Review about 3 years ago

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

#3 Updated by Sebastian Kurfuerst about 3 years ago

  • Status changed from New to Accepted
  • % Done changed from 0 to 20

#4 Updated by Gerrit Code Review about 3 years ago

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

#5 Updated by Gerrit Code Review about 3 years ago

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

#6 Updated by Gerrit Code Review almost 3 years ago

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

#7 Updated by Gerrit Code Review almost 3 years ago

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

#8 Updated by Gerrit Code Review almost 3 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12649

#9 Updated by Gerrit Code Review almost 3 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12649

#10 Updated by Sebastian Kurfuerst almost 3 years ago

  • Status changed from Accepted to Under Review

#11 Updated by Gerrit Code Review almost 3 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12649

#12 Updated by Gerrit Code Review almost 3 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12649

#13 Updated by Gerrit Code Review almost 3 years ago

Patch set 8 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12649

#14 Updated by Gerrit Code Review almost 3 years ago

Patch set 9 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12649

#15 Updated by Sebastian Kurfuerst almost 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 20 to 100

Also available in: Atom PDF