影象和影象資源

從檔案中獲取影象

lib.myImage = IMAGE
lib.myImage.file = fileadmin/My-Image.png
lib.myImage.file.width = 100
lib.myImage.file.height = 100

從頁面屬性中獲取影象

lib.pageImage = IMAGE
lib.pageImage {
    file.import.data = levelmedia: -1, "slide"
    file.import = uploads/media/
    file.import.listNum = 0
    file.import.override.field = media

    border = 0
    altText = xy
    titleText = xy
}

從頁面資源(FAL)獲取影象

lib.pageResources = FILES 
lib.pageResources { 
  references { 
    table = pages 
    uid.data = uid
    fieldName = media
  } 
  renderObj = IMAGE 
  renderObj {
    file { 
      import.data = file:current:uid 
      treatIdAsReference = 1 
      width = 150c 
      height = 150c 
    } 
    altText.data = file:current:alternative
    titleText.data = file:current:title
  } 
  maxItems = 3
}

獲取影象資源

lib.myImage = IMAGE
lib.myImage.file = fileadmin/My-Image.png
lib.myImage.file.width = 100
lib.myImage.file.height = 100
lib.myImage.stdWrap.wrap (
 <div style="background-image:url(|); width:100px; height:100px;">Headline</div>
)

從內容元素中獲取影象

lib.ceImages = FILES
lib.ceImages {
    stdWrap.wrap = <div class="pic">|</div>
    references {
        table = tt_content
        // current CE (needs context)
        #uid.data = uid
        // for CSC
        fieldName = image
        // for FSC
        fieldname = assets
    }
    renderObj = IMAGE
    renderObj {
        file {
            import.data = file:current:uid
            treatIdAsReference = 1
            width = 150c
            height = 150c
        }
        altText.data = file:current:alternative
        titleText.data = file:current:title
        stdWrap.typolink.parameter.data = file:current:link
    }
    maxItems = 5
}