Issue Bug Closed

#86956Typoscript meta tag field settings have no effect

Christoph Sölder 11/20/18, 14:05 updated 08/11/26, 08:46

Description

When defining meta tags with typoscript for example

page {
    meta {
        author = {$page.meta.author}
        author {
             override.field = author
        }
    }
}

the override value is not rendered in the frontend if it is set in the backend.
The frontend alway shows the value set in {$page.meta.author}.

Similar if you define a meta tag that takes it’s value directly from a database field e.g.

page {
    meta {
        author.field = author
    }
}

The tag is not rendered in the frontend.

Using `page.meta.author.replace=1` doesn’t help either.

The only way i got the override to work is the following:

page.meta.author.override.field >
page.meta.author.override.data = DB:pages:{TSFE:id}:author
page.meta.author.override.data.insertData = 1

To me it seems like the parameter “field” isn’t working as expected.

Reviews 3

History 2326

Show 1 earlier messages
  1. Richard Haeser commented and changed status New Accepted <span data-processor="relativetime" data-value="2018-11-20T15:08:20+00:00" > 11/20/18, 15:08 </span>

    I can confirm this issue

  1. Vasyl Mosiychuk commented <span data-processor="relativetime" data-value="2018-12-03T21:37:43+00:00" > 12/03/18, 21:37 </span>

    I can confirm this issue too…

    My TYPO3 9.5.1, PHP 7.2

    page {
        meta {
            author = {$page.meta.author}
            author {
                 override.field = author
            }
            keywords = {$page.meta.keywords}
            keywords {
                 override.field = keywords
            }
        }
    }

    …and it is not working

    page {
        meta {
            author.data = author
            keywords.data = keywords
        }
    }
    page {
        meta {
            author.data = levelfield:-1, author, slide
            keywords.data = levelfield:-1, keywords, slide
        }
    }

    …very strange but it is working

    page {
        meta {
            description = {$page.meta.description}
            description {
                 override.field = description
            }
        }
    }

    …and it is working

    page {
        meta {
            keywords.data = page:keywords
            author.data = page:author
        }
    }
  2. Vasyl Mosiychuk commented <span data-processor="relativetime" data-value="2018-12-06T15:41:43+00:00" > 12/06/18, 15:41 </span>

    Tested on the TYPO3 v. 9.5.1 with Bootstrap Package 10.0.4 – working

    page {
        meta {
            keywords = {$page.meta.keywords}
            keywords {
                stdWrap {
                    override {
                        data = page:keywords
                    }
                }
            }
            author = {$page.meta.author}
            author {
                stdWrap {
                    override {
                        data = page:author
                    }
                }
            }
        }
    }
  3. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2018-12-07T19:25:48+00:00" > 12/07/18, 19:25 </span>

    These are my findings with TYPO3 9.5.2 (latest master)
    - I created three constants
    - on one page, I set the values of the fields author, keyword, description

    These three lines are always present on each test

    page.meta.author = {$page.meta.author} >>> constant is shown
    @page.meta.keywords = {$page.meta.keywords} >>> constant is shown
    page.meta.description = {$page.meta.description}@ >>> Note: in this situation the description field of the page properties will be taken; if not empty!

    For each test, I added the following three lines (each time a different set of lines)

    Test 1 – added:

    page.meta.author.override.field = author >>> Does not work; the constant is shown
    @page.meta.keywords.override.field = keywords@ >>> Does not work; the constant is shown
    @page.meta.description.override.field = description@ >>>Works the field value is taken; but see the previous Note!

    Test 2 – added:

    page.meta.author.data = author >>> *Does not work*; the tag is missing
    page.meta.keywords.data = keywords >>> Does not work; the tag is missing
    @page.meta.description.data = description >>> Works, but see the previous Note!

    Test 4 – added:

    page.meta.author.data = page:author >>> Works the field value is taken; the tag is missing if empty
    @page.meta.keywords.data = page:keywords@ >>> Works the field value is taken; the tag is missing if empty
    @page.meta.description.data = page:description@ >>> Works the field value is taken; the tag is missing if empty

    Test 5 – added:

    page.meta.author.data = levelfield:-1, author, slide >>> Works the field value is taken; also the slide works
    @page.meta.keywords.data = levelfield:-1, keywords, slide@ >>> Works the field value is taken; also the slide works
    @page.meta.description.data = levelfield:-1, description, slide@ >>> Works the field value is taken; also the slide works

    NOTE 2: in Install Tool, set ['FE']['addRootLineFields'] => 'author,description,keywords'

    Test 6 – added:

    page.meta.author.override.data = page:author >>> Works the field value is taken; constant is shown if empty
    @page.meta.keywords.override.data = page:keywords@ >>> Works the field value is taken; constant is shown if empty
    @page.meta.description.override.data = page:description@ >>> Works the field value is taken; constant is shown if empty

    Test 7 – added:

    page.meta.author.stdWrap.override.data = page:author >>> Works the field value is taken; constant is shown if empty
    @page.meta.keywords.stdWrap.override.data = page:keywords@ >>> Works the field value is taken; constant is shown if empty
    @page.meta.description.stdWrap.override.data = page:description@ >>> Works the field value is taken; constant is shown if empty

  4. Richard Haeser commented and changed status Accepted Needs Feedback <span data-processor="relativetime" data-value="2019-02-02T23:00:11+00:00" > 02/02/19, 23:00 </span>

    Can you check again? Can’t reproduce anymore. (Also not on 9.5.1…)

  5. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2019-02-05T09:50:14+00:00" > 02/05/19, 09:50 </span>

    @Richard Haeser I repeated the same tests with 9.5.4 and had slightly different results:

    Test 1 -> same results
    Test 2 -> one different result:
    @page.meta.description.data = description@ >>> Value from field is taken if not empty; Tag is missing if empty
    Test 4 -> same results
    Test 5 -> all different results:
    @page.meta.author.data = levelfield:-1, author, slide@ >>> Does not work; the tag is missing; also the slide works
    @page.meta.keywords.data = levelfield:-1, keywords, slide@ >>> Does not work; the tag is missing; also the slide works
    @page.meta.description.data = levelfield:-1, description, slide@ >>> Value from field is taken if not empty; Tag is missing if empty; also the slide works
    Test 6 -> same results
    Test 7 -> same results

    I cleared the frontend cache before each test.

  6. Benjamin Eyring commented <span data-processor="relativetime" data-value="2019-04-04T18:31:02+00:00" > 04/04/19, 18:31 </span>

    This issue still seems active in 9.5.5

    As a workaround we solved it like this:

    1. Deactivate rendering of the seo tags:
    $GLOBALS[‘TYPO3_CONF_VARS’][‘SC_OPTIONS’][‘TYPO3\CMS\Frontend\Page\PageGenerator’][‘generateMetaTags’] = NULL;

    2. Set the fields to slide=true:
    $GLOBALS[‘TYPO3_CONF_VARS’][‘FE’][‘addRootLineFields’] = ‘og_title,og_description,og_image,twitter_title,twitter_description,twitter_image,author,author_email’;

    3. Manually manage seo tags using TS:

    70 = COA
    70 { # OG:TITLE ###########################################
    10 = TEXT
    10 {
    data = levelfield:-1, og_title, slide
    noTrimWrap = |<meta property=“og:title” content=”|” />|
    } # OG:TYPE ###########################################
    20 = TEXT
    20 {
    value = website
    noTrimWrap = |<meta property=“og:type” content=”|” />|
    } # OG:URL #############################################
    30 = TEXT
    30 {
    typolink {
    parameter.data = tsfe:id
    parameter.insertData = 1
    useCacheHash = 1
    addQueryString = 1
    addQueryString.method = get
    addQueryString.exclude = id
    forceAbsoluteUrl = 1
    returnLast = url
    }
    wrap = <meta property=“og:url” content=”|”>
    } # OG:DESCRIPTION ######################################
    40 = TEXT
    40 {
    data = levelfield:-1, og_description, slide
    stdWrap.wrap = <meta property=“og:description” content=”|” />
    } # OG:IMAGE ############################################ # Adaption for news see below
    50 = FILES
    50 {
    references {
    data = levelfield:-1, og_image, slide
    }
    renderObj = IMG_RESOURCE
    renderObj {
    file.import.data = file:current:publicUrl
    }
    stdWrap.dataWrap = <meta property=“og:image” content=”{site:base}|” />
    required = 1
    }
    }

    TBD: Check, if these tags are set correctly for news detail pages.

    Don’t know if there is a better solution?

  7. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2019-07-06T19:24:40+00:00" > 07/06/19, 19:24 </span>

    I repeated my tests (see comment 4) on 9.5.8 with a more rich scenario:

    - I created three constants:

    page.meta.author = AUTORE DA COSTANTE
    page.meta.keywords = KEYWORD DA COSTANTE
    page.meta.description = DESCRIPTION DA COSTANTE

    - I created four pages

    *Page A*
    Author field: filled with AUTORE DA PAGINA
    Keyword field: filled with KEYWORD DA PAGINA
    Description field: filled with DESCRIPTION DA PAGINA

    *Page B*
    Author field: empty
    Keyword field: empty
    Description field: filled with DESCRIPTION DA PAGINA

    *Page C*
    Author field: filled with AUTORE DA PAGINA
    Keyword field: filled with KEYWORD DA PAGINA
    Description field: empty

    *Page D*
    Author field: empty
    Keyword field: empty
    Description field: empty

    So to sum up

    Page A Page B Page C Page D
    Author filled [empty] filled [empty]
    Kewyord filled [empty] filled [empty]
    Description filled filled [empty] [empty]

    Note: for test 5 that involves the “slide” I created a subpage for each page; the fields on all the subpages are always empty;

    on Install Tool I set ['FE']['addRootLineFields'] => 'author,description,keywords'

    - for each test, the lines:

    page.meta.author = {$page.meta.author} 
    page.meta.keywords = {$page.meta.keywords} 
    page.meta.description = {$page.meta.description}

    are always present

    - before each test, I cleared the cache

    I sum up in the following table the results of all the tests;

    legend:

    for each cell of the table, I report the values taken for Author, Keywords and Description in this order;

    “C” means that the value from the constants is taken; “P” means that the value from the page field is taken; “/” means that the tag is absent

    |_. Test |_. Page A |_.Page B |_.Page C |_.Page D | | only

    page.meta.author = {$page.meta.author}
    page.meta.keywords = {$page.meta.keywords}
    page.meta.description = {$page.meta.description}
    | C C P | C C P | C C C | C C C | |Added:
    page.meta.author.override.field = author 
    page.meta.keywords.override.field = keywords
    page.meta.description.override.field = description

    |Added:

    page.meta.author.data = author
    page.meta.keywords.data = keywords
    page.meta.description.data = description

    |Added:

    page.meta.author.data = page:author 
    page.meta.keywords.data = page:keywords 
    page.meta.description.data = page:description

    |Added:

    page.meta.author.data = levelfield:-1, author, slide 
    page.meta.keywords.data = levelfield:-1, keywords, slide
    page.meta.description.data = levelfield:-1, description, slide 

    | same configuration of the previous line; checked the subpage of each page | P P P| / / P | P P / | / / / | |Added:

    page.meta.author.override.data = page:author 
    page.meta.keywords.override.data = page:keywords
    page.meta.description.override.data = page:description 

    |Added:

    page.meta.author.stdWrap.override.data = page:author 
    page.meta.keywords.stdWrap.override.data = page:keywords 
    page.meta.description.stdWrap.override.data = page:description 

    From a first glance, the test with

    page.meta.author.data = author
    page.meta.keywords.data = keywords
    page.meta.description.data = description

    seems to present the most faulty behavior;

  8. Benni Mack commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2020-03-23T17:00:25+00:00" > 03/23/20, 17:00 </span>

    Just to clear this up:

    page.meta.author.data = author
    page.meta.keywords.data = keywords
    page.meta.description.data = description

    This would/should never ever work:
    https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/DataTypes/Index.html#gettext

    When using .data – you need to have “page:author” or “field:author” (depending on the current data, which is correct in the case of page.meta).

    Looking at your examples, Riccardo, the rest of the results look fine IMHO.

  9. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2020-03-23T17:46:54+00:00" > 03/23/20, 17:46 </span>

    Hello Benni, I report here again the results for each test for clarity, discarding the one with incorrect syntax:

    1) This one still looks faulty , the value of description from the page is always taken even if I have just defined the constants.
    Why only description behaves like that? Is it correct?

    Test Page A _.Page B _.Page C _.Page D
    only

    page.meta.author = {$page.meta.author}
    page.meta.keywords = {$page.meta.keywords}
    page.meta.description = {$page.meta.description}
    C C P C C P C C C C C C

    2) These ones look correct: the override with the values from page is always done when present – and they’re totally equivalent

    |_. Test |_. Page A |_.Page B |_.Page C |_.Page D | |Added:

    page.meta.author.override.field = author 
    page.meta.keywords.override.field = keywords
    page.meta.description.override.field = description

    |Added:

    page.meta.author.override.data = page:author 
    page.meta.keywords.override.data = page:keywords
    page.meta.description.override.data = page:description 

    |Added:

    page.meta.author.stdWrap.override.data = page:author 
    page.meta.keywords.stdWrap.override.data = page:keywords 
    page.meta.description.stdWrap.override.data = page:description 

    3) This looks correct,too: only the values from the page are considered |Added:

    page.meta.author.data = page:author 
    page.meta.keywords.data = page:keywords 
    page.meta.description.data = page:description

    4) Last but not the least, this looks good, too, it is the same as the previous one, plus the “slide” is correctly considered

    |_. Test |_. Page A |_.Page B |_.Page C |_.Page D | |Added:

    page.meta.author.data = levelfield:-1, author, slide 
    page.meta.keywords.data = levelfield:-1, keywords, slide
    page.meta.description.data = levelfield:-1, description, slide 
    same configuration of the previous line; checked the subpage of each page P P P / / P P P / / / /
  10. Benni Mack commented <span data-processor="relativetime" data-value="2020-03-23T17:53:12+00:00" > 03/23/20, 17:53 </span>

    Perfect, Riccardo!

    With your information I spotted the issue, which resides in the EXT:seo MetaTagGenerator where the “description” field is always taken from the page.

  11. Thomas Stranz commented <span data-processor="relativetime" data-value="2020-11-28T02:24:59+00:00" > 11/28/20, 02:24 </span>

    page.meta.description.replace = 1

    worked for me

  12. Richard Haeser commented <span data-processor="relativetime" data-value="2021-01-10T03:21:15+00:00" > 01/10/21, 03:21 </span>

    For the description field it is right you need the .replace parameter. So this is expected behaviour. If you want to override the settings with TypoScript you have to use that parameter.

    If I’m right we can close this issue.

  13. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2021-01-10T08:55:57+00:00" > 01/10/21, 08:55 </span>

    Thomas Stranz, Richard Haeser

    I am trying unluckily without success to find where in the documentation it is stated that page.description is a special case that needs the replace function; (looking at https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/Setup/Page/Index.html?highlight=meta#meta. Is there some other place where to search?)

  14. Richard Haeser commented <span data-processor="relativetime" data-value="2021-01-31T07:30:35+00:00" > 01/31/21, 07:30 </span>

    Riccardo, on the link you have given, in the description of meta you find:

    > replace If set to 1, the tag will replace the one set earlier by a plugin. If set to 0 (default), the meta tag generated by the plugin will be used. If there is none yet, the one from TypoScript is set.

    If that is not sufficient, maybe we have to update the documentation a little bit

  15. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2021-01-31T09:29:44+00:00" > 01/31/21, 09:29 </span>

    @Richard Haeser

    Aw… it is embarrassing I haven’t seen it :O

    > If that is not sufficient, maybe we have to update the documentation a little bit

    I would suggest to add at least an example to make it more evident, and thanks again for finding it.

  16. Clemens Riccabona commented <span data-processor="relativetime" data-value="2026-07-28T08:49:25+00:00" > 07/28/26, 08:49 </span>

    Not sure if this should ever have worked,
    but I still can confirm this does not work:

    page.meta.og:title.data = levelfield:-1, og_title, slide 
  17. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-07-30T08:10:12+00:00" > 07/30/26, 08:10 </span>

    Applied in changeset commit:366b2fb49089b21883eac8293fdbf80e8793a893.