Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default settings for backend layout columns #102

Open
saitho opened this issue Jul 7, 2022 · 2 comments
Open

Default settings for backend layout columns #102

saitho opened this issue Jul 7, 2022 · 2 comments
Labels

Comments

@saitho
Copy link

saitho commented Jul 7, 2022

Not sure if this is the right place or if that should be a TYPO3 core feature.

We're using mutliple extensions providing content elements that should only be used in specific backend layouts.

I'd like to define a default setting for disallowed content elements that is applied to all backend layouts.

Current approach

The current approach would be defining a default value and copying that into the columns in PageTS via copy operator <.
The problem with that is that extensions defining own CEs can not exclude them from all other backend layouts they obviously don't know about.

MyDefaultColumn {
  disallowed {
    CType = some_ce
  }
}

mod {
  web_layout {
    BackendLayouts {
      my_backend_layout {
        config.backend_layout.rows.1 {
          columns {
            1 < MyDefaultColumn
            2 < MyDefaultColumn
          }
        }
      }
    }
  }
}

Suggested approach

Due to the limitations of PageTS in regards of using reference (=<) the suggested approach is supplying a default object for Ext:content_defender which is considered at runtime during evaluation of the settings. This effectively serves as default value for column settings which is extended by the regular settings on the backend layout.

Ext:content_defender

mod.web_layout.ContentDefender {
  Defaults {
    Column {
      disallowed {
        CType = 
      }
    }
  }
}

Ext:my_ext

// disallow my_ce for all backend layout columns
mod.web_layout.ContentDefender.Defaults.Column.disallowed.CType := addToList(my_ce)

mod {
  web_layout {
    BackendLayouts {
      my_backend_layout {
        config {
          backend_layout {
            rows {
              1 {
                columns {
                  1 {
                    disallowed {
                     // but allow it here
                     CType := addToList(my_ce)
                    }
                  }
                  2 {
                    // ...
                    // my_ce is disallowed here
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
@IchHabRecht
Copy link
Owner

Hi @saitho

Thank you for your feature proposal. Currently I don't see any way to include a default allowed/disallowed property in content_defender. If I understand you correctly, you do have a sitepackage providing the backendlayout and its configuration. The sitepackage "knows" about its dependencies (and therefore for loaded extensions and available content element types) and should be able to define allowed/disallowed element types per column.

@BenjaminBeck
Copy link

I needed something similar:
https://github.com/BenjaminBeck/content_defender_mod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants