Coder Social home page Coder Social logo

ichhabrecht / content_defender Goto Github PK

View Code? Open in Web Editor NEW
80.0 9.0 35.0 390 KB

Define allowed or denied content element types in your backend layouts

License: GNU General Public License v2.0

PHP 95.05% TypeScript 4.95%
typo3 typo3-cms typo3-extension content restriction backend layout

content_defender's Introduction

TYPO3 Extension content_defender

Latest Stable Version Build Status StyleCI

Content Defender adds more options to define allowed or denied content element types in your backend layouts

Installation

This extension can be installed using Composer or the Extension Manager.

Composer

composer require ichhabrecht/content-defender

Extension Manager

See TYPO3 Documentation - Managing Extensions - Legacy Guide

Usage

  1. You only need to adjust the column configuration of your backend_layout

Restrict certain content element fields

  • To allow a limited set of values for content element fields use allowed.field = [list of comma separated values]

Examples:

columns {
    1 {
        name = Column with header and textmedia elements
        colPos = 3
        colspan = 6
        allowed {
            CType = header, textmedia
        }
    }
}
columns {
    1 {
        name = Column with News plugin only
        colPos = 3
        colspan = 6
        allowed {
            CType = list
            list_type = news_pi1
        }
    }
}

Combine multiple content element fields

  • The example allows multiple content element types (text and list) while restricting plugin types to news only.

Example:

columns {
    1 {
        name = A column with restricted list_type and "normal" CType
        colPos = 3
        colspan = 6
        allowed {
            CType = textmedia, list
            list_type = news_pi1
        }
    }
}

Deny certain content element types

  • To remove a set of values from content element fields use disallowed.field = [list of comma separated values]

Examples:

columns {
    1 {
        name = Column without divider, plain html and table elements
        colPos = 3
        colspan = 6
        disallowed {
            CType = div, html, table
        }
    }
}
columns {
    1 {
        name = Column with header and list, without News plugin
        colPos = 3
        colspan = 6
        allowed {
            CType = header, list
        }
        disallowed {
            list_type = news_pi1
        }
    }
}

Limit the number of content elements

  • To restrict the number of content elements use maxitems = [number of elements]

Example:

columns {
    1 {
        name = Column with one textmedia 
        colPos = 3
        colspan = 6
        allowed {
            CType = textmedia
        }
        maxitems = 1
    }
}

Known issues

TypeError

count(): Argument #1 ($value) must be of type Countable|array, null given

Content Defender needs the runtime cache to be available. Please ensure that this cache doesn't use a \TYPO3\CMS\Core\Cache\Backend\NullBackend backend.

Community

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.