0

I have not been successful to implement rich snippets in my typo3 site. Basically I have tried to wrap the html tag and include meta snippets to no avail but a chain of site errors.

page.meta.itemprop.name = name
page.meta.itemprop.description = description 
page.meta.itemprop.image = http://www.example.com/img/01.png

The html code is the following

<html itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="name">
<meta itemprop="description" content="description">
<meta itemprop="image" content="http://www.example.com/image.png">

What typoscript should be used?

András Ottó
  • 7,605
  • 1
  • 28
  • 38
Fab
  • 278
  • 4
  • 17

1 Answers1

1

This worked out for me.

config.htmlTag_stdWrap {
    setContentToCurrent = 1
    cObject = COA
    cObject {
        1 = TEXT
        1.value = itemscope 
        1.noTrimWrap = | | |
        2 = TEXT
        2.value = itemtype="http://schema.org/Organization"
        2.noTrimWrap = | | |
  3 = TEXT
        3.value = lang="en"
        wrap = <html | >
    }
}
page {
  headerData {
    4 = TEXT
    4.value (
<meta itemprop="name" content="Your site Name">
<meta itemprop="description" content="Your site description">
<meta itemprop="image" content="http://www.example.com/img/01.png">
    )
  }
}
Fab
  • 278
  • 4
  • 17
  • Any idea of how to add dynamic name and description within the wrap, through typoscript? – Fab Feb 11 '15 at 22:54
  • Yes, you can use stdWrap data or dataWrap to insert values from the current page context. – pgampe Feb 13 '15 at 17:09
  • pgampe thanks, can you give me an example of the code structure please – Fab Feb 16 '15 at 23:09
  • `stdWrap.data` and `stdWrap.dataWrap` have the `getText` data type. Please consult the manual for plenty examples: http://docs.typo3.org/typo3cms/TyposcriptReference/DataTypes/Gettext/Index.html – pgampe Feb 17 '15 at 10:20