How can I insert the current page title automatically into a TYPO3 template?

后端 未结 8 808
终归单人心
终归单人心 2021-02-05 17:08

actually the title is the whole question.

I just want to modify the template so that the current page title is automatically shown (i\'m working with html templates so I

相关标签:
8条回答
  • 2021-02-05 17:41
    lib.page_title = CONTENT
    lib.page_title {
    
        table = pages
    
        select {
            where = uid = 2
        }
    
        renderObj = COA
        renderObj {
    
            10 = TEXT
            10 {
                field = title
                wrap = <h1 class="page_title">|</h1>
            }
    
            20 = TEXT
            20 {
                field = subtitle
                stdWrap.required = 1
                stdWrap.wrap = <h5>|</h5>
            }
        }
    }
    

    call the lib.page_title where want to render typoscript with this lines

    <f:cObject typoscriptObjectPath='lib.page_title' />
    

    I hope this helps !!!

    0 讨论(0)
  • 2021-02-05 17:47
    lib.pagetitle = RECORDS
    lib.pagetitle {
        source.data = page:uid
        tables = pages
        conf.pages = TEXT
        conf.pages.field = nav_title
    }
    

    To get current page title:

    lib.pagetitle = TEXT
    lib.pagetitle.field=title
    

    For meta data :

    Its very important to place meta after header tag when we are gone through mobile compatible website

    In order to prevent quirks mode in IE9 I need to add this lines at the very top of every HTML page:

    You can write the whole header by yourself, by adding disableAllHeaderCode = 1 to your typoscript or you can hack it by adding your meta tag directly to the head tag:

     page.headTag = <head><meta http-equiv="X-UA-Compatible" content="IE=edge" />
    

    Place this at your typoscript

     meta.X-UA-Compatible = IE=edge,chrome=1
    

    httpEquivalent: (Since TYPO3 4.7) If set to 1, the http-equiv attribute is used in the meta tag instead of the “name” attribute. Default: 0.

    For more information about TYPO3 stuff you may visit my blog

    https://jainishsenjaliya.wordpress.com/2013/10/10/put-meta-tag-on-top-of-header-section-in-typo3/

    0 讨论(0)
提交回复
热议问题