lujakob
4/18/2016 - 9:44 AM

Misc Typoscript snippets concerning content

Misc Typoscript snippets concerning content

# render typo3 cObject in template
<f:cObject typoscriptObjectPath="lib.backgroundImage" />

# Render images from page resources field in template.

tmp.backgroundImage = IMAGE
tmp.backgroundImage {
    file {
        import.data = levelmedia:-1, slide
        treatIdAsReference = 1
        import.listNum = 0
    }
    wrap = <div class="visual-item">|</div>
}

lib.backgroundImage = COA
lib.backgroundImage {
    10 < tmp.backgroundImage
    10.file.import.listNum = 0
    20 < tmp.backgroundImage
    20.file.import.listNum = 1
    30 < tmp.backgroundImage
    30.file.import.listNum = 2
    40 < tmp.backgroundImage
    40.file.import.listNum = 3
    50 < tmp.backgroundImage
    50.file.import.listNum = 4
    60 < tmp.backgroundImage
    60.file.import.listNum = 5
    70 < tmp.backgroundImage
    70.file.import.listNum = 6
    80 < tmp.backgroundImage
    80.file.import.listNum = 7
    90 < tmp.backgroundImage
    90.file.import.listNum = 8
    100 < tmp.backgroundImage
    100.file.import.listNum = 9
}


# render field bodytext of specific content element (defined by uid and pid)
lib.contactInfo = CONTENT
lib.contactInfo {
    table = tt_content
    select {
        where = uid=5
        pidInList = 182
        orderBy = sorting
    }
    renderObj = TEXT
    renderObj.field = bodytext
}


# remove plugin default styles
plugin.tx_felogin_pi1._CSS_DEFAULT_STYLE >
plugin.tx_cssstyledcontent._CSS_DEFAULT_STYLE >
plugin.tx_frontend._CSS_DEFAULT_STYLE >


# page types for ajax calls
expertList = PAGE
expertList {
    typeNum = 466

    10 < tt_content.list.20.ljtemplates_expertlist

    config {
        disableAllHeaderCode = 1
        #additionalHeaders = Content-type: application/json
        xhtml_cleaning = 0
        admPanel = 0
        debug = 0
    }
}


# custom body tag
page.bodyTag >
page.bodyTagCObject = TEXT
page.bodyTagCObject.field = uid
page.bodyTagCObject.wrap = <body id="body-id-|" class="standard">

[globalVar = TSFE:id = 1]
    page.bodyTagCObject.wrap = <body id="body-id-|" class="home">
[end]


# condition for checking of formhandler has submitted
SHOWFORM =

[globalVar = GP:formhandler|submitted > 0]
SHOWFORM = show-form
[end]