Reputation: 1626
I'm currently working on the SEO for my webpage. Therefor I want to get the page.meta.author/title/description... from the News Article that is currently opened in the browser. If there is non set, it should fall back to the default configured in the constants.
I'm working on something like that:
page.meta {
author < plugin.tx_news.currentNewsItem.author // I don't know what to write here
author.ifEmpty = {$page.meta.author}
}
Also I'm not sure what the following code does:
page.meta {
author {
override.field = author
}
}
I appreciate all the help.
Upvotes: 0
Views: 1254
Reputation: 1626
As @Ghanshyam Bhava suggested in the comments, I used this inside my setup typoscript:
[globalVar = GP:tx_news_pi1|news > 0]
page {
config {
noPageTitle = 0
}
headerData {
776 >
}
meta {
description >
author >
keywords >
}
}
[end]
I only had to modify the headerdata number, because I'm using the SEO_Basics extension and I also had to make sure the hierarchy of the extensions was right in the template.
For the page meta tags I used the default once defined in the constants typoscript as long as the above condition was not met of course.
Upvotes: 1