0
votes

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.

1
as gridelements is not a requirement for news, the corresponding configuration must be set already somewhere individually, probably in PageTS or UserTS. - David
I've updated my question above. Problem is the allowed setting for my backend layout. - Peter Kraume
You must be using ext:content_defender which provides the allowed property, right? - Urs

1 Answers

2
votes

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.