Task #54137

Task #53046: Reduce generated code of ContentElementWrappingService

Deprecate ContentElement ViewHelper

Added by Bastian Waidelich over 1 year ago. Updated over 1 year ago.

Status:Resolved Start date:2013-12-02
Priority:Should have Due date:
Assigned To:Bastian Waidelich % Done:

100%

Category:-
Target version:Base Distribution - 1.0 beta 2

Description

In order to simplify content element templates, the ContentElement ViewHelper should not be required.
Instead all required meta data attributes should be added via a TS processor.

Old Template:

1<neos:contentElement node="{node}">
2  {someProperty}
3</neos:contentElement>

New Template:

1<div>
2  {someProperty}
3</div>

For B/C reasons the ContentElement ViewHelper should still render a tag.

Associated revisions

Revision a9a42527
Added by Bastian Waidelich over 1 year ago

[TASK] Deprecate ContentElement ViewHelper

This change makes the ContentElement ViewHelper obsolete. Required
meta data attributes are added via a TypoScript processor on all
TS objects extending ``TYPO3.Neos:Content``.

Old CE template::
<neos:contentElement node="{node}"> {someProperty}
</neos:contentElement>

New CE template::
<div> {someProperty}
</div>

Note: It's recommended to always add a unique root element to your CE
template (the div tag in this example) so that the TypoScript processor
can use that to add meta data attributes.
Otherwise a wrapping tag will be added in the backend.

This change has following effects in detail:

  • Deprecate ContentElement ViewHelper in a backwards compatible way.
    If used, the ViewHelper still renders a tag but this has no
    advantage over hard-coding that tag in the template itself
  • Add ``ContentElementWrappingImplementation`` TypoScript object and
    register it as processor to all ``TYPO3.Neos:Content`` elements.
  • Remove ``neosBackendDocumentNodeData`` TS object & template and
    render document node meta data in the NeosBackendHeaderData.html
    template instead using a new ViewHelper that renders a meta tag in
    the head of the backend html (instead of a hidden div in the body).

Change-Id: I91f05e798229e7d6bd613d14a43e68d79678a8a0
Resolves: #54137
Reviewed-on: https://review.typo3.org/25883
Tested-by: Bastian Waidelich
Reviewed-by: Christopher Hlubek
Tested-by: Christopher Hlubek
Reviewed-by: Aske Ertmann
Tested-by: Aske Ertmann
Reviewed-by: Bastian Waidelich

Revision c7aff58b
Added by Bastian Waidelich over 1 year ago

[TASK] Adjust Shortcut templates to improved wrapping

This adjusts the Shortcut CE template to the improved
ContentElementWrappingService introduced with
I91f05e798229e7d6bd613d14a43e68d79678a8a0

Furthermore this replaces chained if ViewHelpers by
switch/case ViewHelpers for good measure.

Change-Id: Icdbd8cf51bc4a74e7a947c0d380122e2a61ed4bf
Related: #54137
Reviewed-on: https://review.typo3.org/25898
Reviewed-by: Bastian Waidelich
Tested-by: Bastian Waidelich
Reviewed-by: Aske Ertmann
Tested-by: Aske Ertmann

Revision 38698f29
Added by Bastian Waidelich over 1 year ago

[!!!][TASK] Generate content element class attributes via TypoScript

Currently classes such as "typo3-neos-nodetypes-text" or
"typo3-neos-nodetypes-headline" are added automagically added through
the ``ContentElementWrappingService``.

This change moves the creation of class attributes in the frontend to
a new property ``attributes`` of the ``TYPO3.Neos:Content``
TypoScript object so that its behavior can be adjusted.

If you don't need these auto-generated class attributes you can
disable this behavior in your site's TypoScript with::

prototype(TYPO3.Neos:Content) {
>
}

This is a breaking change because it removes the previously rendered
"neos-contentelement" class attribute. It also disables the
auto-generated id attribute (id="c<UUID>") for now.
If you need this behavior, you could add it to your TypoScript via::

prototype(TYPO3.Neos:Content) {
attributes.id = ${'c' + q(node).property('_identifier')}
}

Change-Id: I54f3b27eaf1f3bb1d353609cb2ea6679ed35fc08
Related: #54137
Reviewed-on: https://review.typo3.org/25911
Reviewed-by: Bastian Waidelich
Tested-by: Bastian Waidelich
Reviewed-by: Aske Ertmann
Tested-by: Aske Ertmann
Reviewed-by: Christian Mueller
Tested-by: Christian Mueller

Revision 5d9a1972
Added by Dominique Feyer over 1 year ago

[BUGFIX] Empty content elements must be wrapped correctly

The ``HtmlAugmenter`` that is used to add meta data attributes to content
elements in the backend issues a warning if the given content is an
empty string.

This change fixes this by adding an empty check to the
``getHtmlRootElement()`` method.

Change-Id: I088dfc92397a3fb891cb0f97bce451dd9043f342
Related: #54137
Reviewed-on: https://review.typo3.org/25964
Reviewed-by: Bastian Waidelich
Tested-by: Bastian Waidelich
Reviewed-by: Christopher Hlubek
Tested-by: Christopher Hlubek

History

#1 Updated by Gerrit Code Review over 1 year ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/25883

#2 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/25883

#3 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/25883

#4 Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/25883

#5 Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/25883

#6 Updated by Bastian Waidelich over 1 year ago

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

#7 Updated by Bastian Waidelich over 1 year ago

  • Target version set to 1.0 beta 2

Also available in: Atom PDF