prototype(Newland.CityTheme:PressArticleList) < prototype(Neos.Neos:Content) {
    scope = ${q(node).property('scope')}

    articles = Neos.Fusion:Case {
        all {
            condition = ${q(node).property('scope') == 'all'}
            renderer = ${q(site).find('[instanceof Newland.CityTheme:PressArticle]').sort('articlePublishingDate', 'DESC')}
        }

        childrenOnly {
            condition = ${q(node).property('scope') == 'childrenOnly'}
            renderer = ${q(documentNode).find('[instanceof Newland.CityTheme:PressArticle]').sort('articlePublishingDate', 'DESC')}
        }

        selectedOnly {
            condition = ${q(node).property('scope') == 'selectedOnly'}
            renderer = ${q(node).property('selectedArticles')}
        }

        lastThree {
            condition = ${q(node).property('scope') == 'lastThree'}
            renderer = ${q(site).find('[instanceof Newland.CityTheme:PressArticle]').sort('articlePublishingDate', 'DESC')}
        }

        fallback {
            condition = true
            renderer = ${q(site).find('[instanceof Newland.CityTheme:PressArticle]').sort('articlePublishingDate', 'DESC')}
        }
    }

    articlesCount = Neos.Fusion:Case {
        all {
            condition = ${q(node).property('scope') == 'all'}
            renderer = ${q(site).find('[instanceof Newland.CityTheme:PressArticle]').count()}
        }

        childrenOnly {
            condition = ${q(node).property('scope') == 'childrenOnly'}
            renderer = ${q(documentNode).find('[instanceof Newland.CityTheme:PressArticle]').count()}
        }

        selectedOnly {
            condition = ${(q(node).property('scope') == 'selectedOnly') && q(node).property('selectedArticles')}
            renderer = ${Array.length(q(node).property('selectedArticles'))}
        }

        lastThree {
            condition = ${q(node).property('scope') == 'lastThree'}
            renderer = '3'
        }

        fallback {
            condition = true
            renderer = ${q(site).find('[instanceof Newland.CityTheme:PressArticle]').count()}
        }
    }

    // Variables for Pagination
    currentPage = ${request.arguments.page || '1'}
    itemsPerPage = ${q(node).property('itemsPerPage') || 10}
    totalPages = ${Math.ceil(this.articlesCount / this.itemsPerPage)}

    // Variables for iteration on page basis
    minItems = ${(this.itemsPerPage * (this.currentPage - 1) + 1)}
    maxItems = ${this.itemsPerPage * this.currentPage}

    dateFormat = Neos.Fusion:Case {
        german {
                condition = ${locale == 'de'}
                renderer = ${'d. MMMM yyyy'}
        }

        english {
                condition = ${locale == 'en'}
                renderer = ${'MMMM d, yyyy'}
        }

        french {
                condition = ${locale == 'fr'}
                renderer = ${'d MMMM yyyy'}
        }

        fallback {
                condition = ${true}
                renderer = ${'d. MMMM yyyy'}
        }
    }

    locale = ${q(node.context.dimensions.language).get(0)}
    @context.locale = ${q(node.context.dimensions.language).get(0)}

    link = ${q(node).property('link')}
    link.@process.convertUris = Neos.Neos:ConvertUris

    @cache {
        mode = 'uncached'
        context {
            1 = 'site'
            2 = 'node'
            3 = 'documentNode'
        }
    }
}
