简体   繁体   中英

Configurable logo for the template

I am using Fluid for developing a typo3 v8.1 template. I want to give the user the possibility to comfortable change the logo in the backend. It should be possible to change the logo for each page.

How to do this?

You can use typoscript for this.

lib.logo = IMG_RESOURCE
lib.logo.file = fileadmin/logo.jpg
lib.logo.file.width = 100
lib.logo.file.height = 100
lib.logo.stdWrap.wrap (
 <img src="|" alt="logo"/>
)

So, when the user wants to change the logo, the thing is need to do is to change lib.logo.file.

Check this code :

lib.logoImage = FILES
lib.logoImage {
  references {
    table = pages
    uid.data = tsfe:id
    data = levelmedia: -1, slide
    fieldName = media
  }


  renderObj = TEXT
  renderObj {
    data = file:current:publicUrl
    wrap = <img src="|" />
  }
}

Add logo : edit page, go to page resources tab and add logo image

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM