Breaking: #4 - Change content elements basic constants and setup typoscript paths

See https://jira.typo3.com/browse/THEP-174

Description

We decided to group all settings of the content elements to get a nicer overview of all constants and the setup given in the higher education package.

The default content elements settings of the higher education package are defined in EXT:higher_education_package/Condiguration/TypoScript/Constants/contentelements.typoscript and EXT:higher_education_package/Condiguration/TypoScript/Setup/contentelements.typoscript

Note

We renamed the constant and setup files from lib.contentElement.typoscript to contentelements.typoscript. If you have changed constants or the setup of content elements you have to update or migrate them into the plugin.tx_highereducationpackage.contentelements tree.

Important

If you have changed or added new paths for your content elements please adjust them as shown here: Overriding the FLUID templates.

Constants

Old content elements constants

plugin.higher_education_package_contentelements {
    view {
        # cat=higher education package: content/130/layoutRootPath; type=string; label=Layout Root Path: Path to layouts
        layoutRootPath = EXT:higher_education_package/Resources/Private/Layouts/ContentElements/
        # cat=higher education package: content/130/partialRootPath; type=string; label=Partial Root Path: Path to partials
        partialRootPath = EXT:higher_education_package/Resources/Private/Partials/ContentElements/
        # cat=higher education package: content/130/templateRootPath; type=string; label=Template Root Path: Path to templates
        templateRootPath = EXT:higher_education_package/Resources/Private/Templates/ContentElements/
    }

    header {
        # cat=higher education package: content/132/defaultHeaderType; type=int[1-4]; label=Default Header type: Enter the number of the header layout to be used by default
        defaultHeaderType = 2
    }

    textpic {
        # cat=higher education package: content/133/imageProportion; type=options[33%=4,50%=6]; label=Default Textpic image proportion
        imageProportion = 4

        # cat=higher education package: content/133/imageMaxWidth; type=int; label=Max width of image in text
        imageMaxWidth = 500
    }

    image {
        # cat=higher education package: content/134/imageMaxWidth; type=int; label=Max width of image element (gallery)
        imageMaxWidth = 1600

        #$lg breakpoint width (992px) to guarantee nice image rendering
        tabletImageMaxWidth = 992

        #$sm breakpoint width (576px) to guarantee nice image rendering
        mobileImageMaxWidth = 576
    }

    imagezoom {
        # cat=higher education package: content/131/lightbox1; type=string; label= Click-enlarge Media Width: This specifies the width of the enlarged media element when click-enlarge is enabled
        linkWrap.width = 1280m
        # cat=higher education package: content/131/lightbox2; type=string; label= Click-enlarge Media Height: This specifies the height of the enlarged media element when click-enlarge is enabled
        linkWrap.height = 1024m
        # cat=/131/lightbox3; type=boolean; label= Lightbox click-enlarge rendering: Whether media elements with click-enlarge checked should be rendered lightbox-compliant
        linkWrap.lightboxEnabled = 0
        # cat=/131/lightbox4; type=string; label= Lightbox CSS class: Which CSS class to use for lightbox links (only applicable if lightbox rendering is enabled)
        linkWrap.lightboxCssClass = lightbox
        # cat=/131/lightbox5; type=string; label= Lightbox data-lightbox="" attribute: Which data-lightbox="" attribute to use for lightbox links (only applicable if lightbox rendering is enabled)
        linkWrap.lightboxRelAttribute = lightbox[{field:uid}]
    }
}

Changed content elements constants

plugin.tx_highereducationpackage {
    contentelements {
        view {
            # cat=higher education package: content/130/layoutRootPath; type=string; label=Layout Root Path: Path to layouts
            layoutRootPath = EXT:higher_education_package/Resources/Private/Layouts/ContentElements/
            # cat=higher education package: content/130/partialRootPath; type=string; label=Partial Root Path: Path to partials
            partialRootPath = EXT:higher_education_package/Resources/Private/Partials/ContentElements/
            # cat=higher education package: content/130/templateRootPath; type=string; label=Template Root Path: Path to templates
            templateRootPath = EXT:higher_education_package/Resources/Private/Templates/ContentElements/
        }

        header {
            # cat=higher education package: content/132/defaultHeaderType; type=int[1-4]; label=Default Header type: Enter the number of the header layout to be used by default
            defaultHeaderType = 2
        }

        textpic {
            # cat=higher education package: content/133/imageProportion; type=options[33%=4,50%=6]; label=Default Textpic image proportion
            imageProportion = 4

            # cat=higher education package: content/133/imageMaxWidth; type=int; label=Max width of image in text
            imageMaxWidth = 500
        }

        image {
            # cat=higher education package: content/134/imageMaxWidth; type=int; label=Max width of image element (gallery)
            imageMaxWidth = 1600

            #$lg breakpoint width (992px) to guarantee nice image rendering
            tabletImageMaxWidth = 992

            #$sm breakpoint width (576px) to guarantee nice image rendering
            mobileImageMaxWidth = 576
        }

        imagezoom {
            # cat=higher education package: content/131/lightbox1; type=string; label= Click-enlarge Media Width: This specifies the width of the enlarged media element when click-enlarge is enabled
            linkWrap.width = 1280m
            # cat=higher education package: content/131/lightbox2; type=string; label= Click-enlarge Media Height: This specifies the height of the enlarged media element when click-enlarge is enabled
            linkWrap.height = 1024m
            # cat=/131/lightbox3; type=boolean; label= Lightbox click-enlarge rendering: Whether media elements with click-enlarge checked should be rendered lightbox-compliant
            linkWrap.lightboxEnabled = 0
            # cat=/131/lightbox4; type=string; label= Lightbox CSS class: Which CSS class to use for lightbox links (only applicable if lightbox rendering is enabled)
            linkWrap.lightboxCssClass = lightbox
            # cat=/131/lightbox5; type=string; label= Lightbox data-lightbox="" attribute: Which data-lightbox="" attribute to use for lightbox links (only applicable if lightbox rendering is enabled)
            linkWrap.lightboxRelAttribute = lightbox[{field:uid}]
        }
    }
}

Setup

Old content elements setup

lib.contentElement = FLUIDTEMPLATE
lib.contentElement {
    ################
    ### TEMPLATE ###
    ################
    templateName = Default
    templateRootPaths {
        5 = EXT:higher_education_package/Resources/Private/Templates/ContentElements/
        10 = {$plugin.higher_education_package_contentelements.view.templateRootPath}
    }

    partialRootPaths {
        5 = EXT:higher_education_package/Resources/Private/Partials/ContentElements/
        10 = {$plugin.higher_education_package_contentelements.view.partialRootPath}
    }

    layoutRootPaths {
        5 = EXT:higher_education_package/Resources/Private/Layouts/ContentElements/
        10 = {$plugin.higher_education_package_contentelements.view.layoutRootPath}
    }

    ################
    ### SETTINGS ###
    ################
    settings {
        header {
            defaultHeaderType = {$plugin.higher_education_package_contentelements.header.defaultHeaderType}
        }
        media {
            popup {
                bodyTag = <body style="margin:0; background:#fff;">
                wrap = <a href="javascript:close();"> | </a>
                width = {$plugin.higher_education_package_contentelements.imagezoom.linkWrap.width}
                height = {$plugin.higher_education_package_contentelements.imagezoom.linkWrap.height}
                crop.data = file:current:crop
                JSwindow = 1
                JSwindow {
                    newWindow = {$plugin.higher_education_package_contentelements.imagezoom.linkWrap.newWindow}
                    if.isFalse = {$plugin.higher_education_package_contentelements.imagezoom.linkWrap.lightboxEnabled}
                }
                directImageLink = {$plugin.higher_education_package_contentelements.imagezoom.linkWrap.lightboxEnabled}
                linkParams.ATagParams.dataWrap =  class="{$plugin.higher_education_package_contentelements.imagezoom.linkWrap.lightboxCssClass}" rel="{$styles.content.textmedia.linkWrap.lightboxRelAttribute}"
            }
        }
    }
}

Changed content elements setup

plugin.tx_highereducationpackage {
    contentelements = FLUIDTEMPLATE
    contentelements {
        ################
        ### TEMPLATE ###
        ################
        templateName = Default
        templateRootPaths {
            5 = EXT:higher_education_package/Resources/Private/Templates/ContentElements/
            10 = {$plugin.tx_highereducationpackage.contentelements.view.templateRootPath}
        }

        partialRootPaths {
            5 = EXT:higher_education_package/Resources/Private/Partials/ContentElements/
            10 = {$plugin.tx_highereducationpackage.contentelements.view.partialRootPath}
        }

        layoutRootPaths {
            5 = EXT:higher_education_package/Resources/Private/Layouts/ContentElements/
            10 = {$plugin.tx_highereducationpackage.contentelements.view.layoutRootPath}
        }

        ################
        ### SETTINGS ###
        ################
        settings {
            header {
                defaultHeaderType = {$plugin.tx_highereducationpackage.contentelements.header.defaultHeaderType}
            }
            media {
                popup {
                    bodyTag = <body style="margin:0; background:#fff;">
                    wrap = <a href="javascript:close();"> | </a>
                    width = {$plugin.tx_highereducationpackage.contentelements.imagezoom.linkWrap.width}
                    height = {$plugin.tx_highereducationpackage.contentelements.imagezoom.linkWrap.height}
                    crop.data = file:current:crop
                    JSwindow = 1
                    JSwindow {
                        newWindow = {$plugin.tx_highereducationpackage.contentelements.imagezoom.linkWrap.newWindow}
                        if.isFalse = {$plugin.tx_highereducationpackage.contentelements.imagezoom.linkWrap.lightboxEnabled}
                    }
                    directImageLink = {$plugin.tx_highereducationpackage.contentelements.imagezoom.linkWrap.lightboxEnabled}
                    linkParams.ATagParams.dataWrap =  class="{$plugin.tx_highereducationpackage.contentelements.imagezoom.linkWrap.lightboxCssClass}" rel="{$styles.content.textmedia.linkWrap.lightboxRelAttribute}"
                }
            }
        }
    }
}