1

Is it possible to configure which content element types are available for the content elements relation in tx_news records?

I have a backend layout which allows only gridelements in tt_content. The regular content elements are only allowed within a grid elements container.

Currently I face the problem, that in news records it's only possible to add grid elements:

enter image description here

I'd like to allow only some specific content elements in news records.

Update:

The above mentioned restriction is done via TSConfig for the BackendLayout:

mod.web_layout.BackendLayouts {
  1 {
    title = Standardseite
    config {
      backend_layout {
        colCount = 1
        rowCount = 1
        rows {
          1 {
            columns {
              1 {
                name = Content
                colPos = 0
                allowed = gridelements_pi1
              }
            }
          }
        }
      }
    }
  }
}

When I remove the line allowed = gridelements_pi1, all content element types are available again.

But regardless of the allowed setting for backend layouts I'd like to have just a small subset of content element types available for news records.

Peter Kraume
  • 3,577
  • 2
  • 21
  • 39
  • as gridelements is not a requirement for news, the corresponding configuration must be set already somewhere individually, probably in PageTS or UserTS. – David Dec 28 '20 at 12:27
  • https://docs.typo3.org/m/typo3/reference-tsconfig/master/en-us/PageTsconfig/TceForm.html#config – David Dec 28 '20 at 12:41
  • I've updated my question above. Problem is the `allowed` setting for my backend layout. – Peter Kraume Dec 28 '20 at 21:05
  • You must be using `ext:content_defender` which provides the `allowed` property, right? – Urs May 15 '21 at 12:50

1 Answers1

3

Sometimes the solution can be so simple and obvious! Thx for hint, Georg Ringer!

Just override the settings for the news sys folder:

[45 in tree.rootLineIds]
# this changes the allowed CTypes. Add more as a comma separated list
mod.web_layout.BackendLayouts.1.config.backend_layout.rows.1.columns.1.allowed = textmedia
# this sets the default CType to prevent an error with INVALID VALUE ("text")
TCAdefaults.tt_content.CType = textmedia
[global]

By the way, an even better solution would be to use TCEFORM.tt_content.CType.removeItem = ..., but this would require to update the list each time you add a new CType.

Peter Kraume
  • 3,577
  • 2
  • 21
  • 39
  • `TCEFORM.tt_content.CType.removeItem` wouldn't restrict to the one field in the news-plugin only, so this solution is still in draft-mode – David Dec 29 '20 at 21:19
  • This solution works, but it has to be "allowed.CType = textmedia" not "allowed = textmedia" according to the content_defender documentation: https://github.com/IchHabRecht/content_defender/blob/main/README.md – m4a May 02 '22 at 12:17