Bug #86956

Typoscript meta tag field settings have no effect

Added by Christoph Sölder 4 months ago. Updated about 1 month ago.

Status:
Needs Feedback
Priority:
Must have
Assignee:
-
Category:
SEO
Target version:
-
Start date:
2018-11-20
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

History

#1 Updated by Richard Haeser 4 months ago

  • Status changed from New to Accepted

I can confirm this issue

#2 Updated by Vasyl Mosiychuk 4 months ago

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
    }
}

#3 Updated by Vasyl Mosiychuk 3 months ago

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
                }
            }
        }
    }
}

#4 Updated by Riccardo De Contardi 3 months ago

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

#5 Updated by Richard Haeser about 2 months ago

  • Status changed from Accepted to Needs Feedback

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

#6 Updated by Riccardo De Contardi about 1 month ago

@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.

Also available in: Atom PDF