質問

I'm trying to write Typoscript that will configure the Typo3 Rich Text Editor to wrap a given element with more than one class.

In the project's TsConfig/Page/rte.txt file, I have:

RTE {
    classes {
        button {
            name = Button
        }
    }

However, I'd like to create a wrapper that would give the element more than just a single class. The below code doesn't work, but illustrates what I'm trying to accomplish:

RTE {
    classes {
        button {
            name = Button
        }
        button danger {
            name = Dangerous Button
        }
    }

According to this article, this doesn't seem to be possible, but I thought I'd ask and see if someone out there got crafty with their Typoscript and was able to accomplish this.

役に立ちましたか?

解決

I tried everything to handle styles for tables that way, but there is currently no way to handle more than one CSS-Class for a RTE style definition.

The only way to handle this, is creating new CSS classes and extend the available button styles via LESS or SCSS.

他のヒント

In TYPO3 7 you can use this following RTE configuration to use multiple classes. The magic happens in the class-definition with the attribute "required"

RTE {
  default {
    proc.allowedClasses := addToList(btn-dark)
    buttons.link.properties.class.allowedClasses := addToList(btn-dark)
  }
  classes.btn-dark {
    name = Dark-Button
    requires = btn btn-small
  }
  classesAnchor.buttonDark {
    class = btn-dark
    type = page
  }
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top