Task #50192

Story #50191: As an integrator I want an extensible way of including JavaScript and CSS

TypoScript: Create tag-based object

Added by Christopher Hlubek about 2 years ago. Updated almost 2 years ago.

Status:Resolved Start date:2013-07-19
Priority:Should have Due date:
Assigned To:Christopher Hlubek % Done:

100%

Category:Content Rendering Spent time: -
Target version:1.0 beta 1

Description

There should be a TypoScript object that makes it easy to render all kinds of tag based output and to manipulate attributes in a safe and extensible way.

Example:


// Default configuration
page.bodyTag = Tag {
    tagName = 'body'
    omitClosingTag = TRUE
}

// Extension in custom site package
page.bodyTag {
    attributes {
        class = 'landing-page'
        id = 'product-a'
    }
}

Idea for CSS classes:

- Use (new) processors on class Attribute: class.@processors.myClass = ${String.append('my-class')}
- Maybe add special support for classes attribute that allows whitespaced concatenation using some kind of Array (e.g. classes.myClass ="my-class")

Associated revisions

Revision cfc64cf0
Added by Christopher Hlubek almost 2 years ago

[FEATURE] Implement a Tag TypoScript object

This change implements a versatile Tag TypoScript object to generate
correctly escaped markup that is easily extensible. For extensible
attributes a new RawArray object that extends the Array object is
provided which will not evaluate to a string but to a real array and
which provides the same positioning capabilities.

Example:

// Base definition
container = TYPO3.TypoScript:Tag {
tagName = 'section'
}
// Custom site package
container {
attributes {
class = 'landing-page'
id = 'product-a'
}
}

Change-Id: I29b7ac50cbe3bccaddd313a2dc5b8d02e973781e
Resolves: #50192
Reviewed-on: https://review.typo3.org/22472
Tested-by: Mr. Hudson
Reviewed-by: Christian Mueller
Tested-by: Christian Mueller

History

#1 Updated by Gerrit Code Review about 2 years ago

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

#2 Updated by Christopher Hlubek about 2 years ago

  • Status changed from Accepted to Under Review

#3 Updated by Gerrit Code Review about 2 years ago

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

#4 Updated by Adrian Föder about 2 years ago

Christopher, similar to "classes" could work "styles", but with a semicolon "implosion". WDYT?

#5 Updated by Gerrit Code Review about 2 years ago

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

#6 Updated by Gerrit Code Review about 2 years ago

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

#7 Updated by Gerrit Code Review almost 2 years ago

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

#8 Updated by Christopher Hlubek almost 2 years ago

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

Applied in changeset commit:cfc64cf0bec9b598cebc9e1e35dcab540caf1762.

Also available in: Atom PDF