Subscribe to Acqal

Got Thoughts? Write Us!

Contact
Request
Validate

Approved TYPO3 Agency

Acqal is an approved TYPO3 agency focusing on support, training and website migration.

This means that we...

  • are available on TYPO3.org
  • make substantial contributions to TYPO3 teams
  • are registered as business members of the TYPO3 Association
  • have completed more than four TYPO3 projects
  • have proven our technical abilities with quality TYPO3 extensions
  • use TYPO3 for our own website

Acqal is a TYPO3 Association Business Member

Popular Blog Posts

Blog Topics

Virgil on Twitter

Please wait while virgilhuston tweets load Twitter is loading

Recent Blog Posts

Blog Archives

Automatic tt_news META descriptions via Acqal's extension aqnewsmeta

aqnewsmeta meta description

aqnewsmeta meta description

aqnewsmeta constants editor

aqnewsmeta constants editor

aqnewsmeta include static

aqnewsmeta include static
Wednesday, April 15, 2009 2:38 AM EDT

By: Michael Cannon

voting in progress Submitting your vote...
Rating: 4.5 of 5. 2 vote(s).
Click the rating bar to rate this item.

Acqal is pleased to announce the version 1.0.0 release of aqnewsmeta. This extension updates the TYPO3 newsSubheader register with a truncated, HTML-free version of the news bodytext if no article teaser is available.

This is helpful for SEO purposes where each news entry should have a META description, but doesn't.

The extension includes options to adjust the META description length, currently set at 150 characters, per SEO best practices.

References

Keywords:

  • typo3,tt_news,meta,seo,description

Please Share This Post

Tweet thisRedditBookmark on deliciousStumble thisShare on Facebook

Send this article via email to your friends and peers.

Leave a Comment

Add comment

* - required field







Notify me when a new comment is added.
By Dmitry Dulepov on Wednesday, December 31, 1969 9:29 PM EST
Gravatar: Dmitry Dulepov No need for extension. Here is a simple TS for the same purpose:

page.headerData {
200 = TEXT
200.data = page:keywords
200.required = 1
200.wrap = <meta name="keywords" content="|" />
200.htmlspecialchars = 1

210 = TEXT
210.data = page:description
210.required = 1
210.wrap = <meta name="description" content="|" />
210.htmlspecialchars = 1
}
[globalVar = GP:tx_ttnews|tt_news > 0]
page.headerData.200.override.data = register:newsKeywords
page.headerData.210.override.data = register:newsSubheader
[global]
By Michael Cannon on Wednesday, December 31, 1969 9:33 PM EST
Gravatar: Michael Cannon Dmitry,

Thank you for the code suggestion. I had seen this before.

1. Why do you generate the meta tag fully instead of letting TYPO3 do so via the following?

page.meta.keywords = {$site.meta.keywords}
page.meta.keywords.if.isTrue = {$site.sitewide.seo}
page.meta.keywords.override.field = keywords

page.meta.description = {$site.meta.description}
page.meta.description.if.isTrue = {$site.sitewide.seo}
page.meta.description.override.field = description


The above code lets a global SEO setting be made and in turn be overridden by SEO settings in page properties.

2. Your code doesn't account for there being no tt_news.short data. The extension does by checking for the tt_news.short field and if there's nothing, then cropping tt_news.bodytext down to size. See http://typo3.org/extensions/repository/view/aqnewsmeta/current/info/class.tx_aqnewsmeta.php/.

In reality, your code and the aqnewsmeta extension can work side-by-side still because aqnewsmeta is updating register:newsSubheader with data one way or another.

3. On our article pages, we use the following TypoScript for news meta tags.

page.meta.keywords >
page.meta.keywords.data = register:newsKeywords

page.meta.description >
page.meta.description.data = register:newsSubheader


Your thoughts?

On a side note, it's not recommended to use sitewide SEO settings as search engines really ding websites with them. However, sometimes clients ask for stuff and won't take best practices to heart. So it's there...
By Dmitry Dulepov on Wednesday, December 31, 1969 9:37 PM EST
Gravatar: Dmitry Dulepov 1. I just like header data
2. I provided an example, not a fully working solution. My point is that there is no need for extension when it can be done with pure TS :) I use similar code on my own blog.
3. There is a research about how search engines use these tags. I do not remember who published it but the link was a couple of weeks ago at seomoz. It was tested with Google, Yahoo and Live.
By Michael Cannon on Wednesday, December 31, 1969 9:42 PM EST
Gravatar: Michael Cannon Dmitry, thank you again for the comments.

However, I really think you're missing the point of the extension. It's not to generate the META tag, but to populate the register:newsSubheader with truncated, HTML free news bodytext when the news teaser is empty.

This is something that's not possible by TypoScript. Sure TypoScript has REGISTER access, but it doesn't readily have the tt_news record information handy.

I know it's possible to pull the tt_news record via RECORDS, but we're getting to the point of creating something most folks don't get.
By Michael Cannon on Wednesday, December 31, 1969 9:46 PM EST
Gravatar: Michael Cannon Here's the TypoScript to pull the news short or bodytext. I'm still trying to figure out how to push it to page.meta.description, such that the meta description tag is created correctly without resorting to generating my own page.headerData entry.

lib.news.meta.description = RECORDS
lib.news.meta.description {
dontCheckPid = 1
tables = tt_news
source.data = GPvar:tx_ttnews|tt_news
source.insertData = 1
conf.tt_news = TEXT
conf.tt_news {
field = short
ifEmpty.field = bodytext
required = 1
htmlSpecialChars = 0
crop = 150|...|1
stripHtml = 1
trim = 1
}
}


Ideas to improve this are welcome.
By Michael Cannon on Wednesday, December 31, 1969 11:20 PM EST
Gravatar: Michael Cannon Okay, I figured how to get what I wanted with TypoScript and simplify things a little.

I'm already using the awesome seo_basics extension and I decided to add onto their TypoScript setup. In my changes, 'm also defaulting my page meta description to the page title, when there's no page description.

Next, there's the start of my canonical link tag. However, the exclude property isn't working for array type parameters like tx_ttnews[tt_news] for being removed from category pages. Frustrating...

Also, when on news pages, meta description tries for the news article short text, but if none, it grabs and crops the bodytext.


# if no page description or default, at least bring in page title
plugin.tx_seobasics.40.ifEmpty.data = page:title

# create canonical tag
plugin.tx_seobasics.60 = TEXT
plugin.tx_seobasics.60 < .30
plugin.tx_seobasics.60 {
stdWrap >
typolink {
parameter.data = TSFE:id
addQueryString = 1
addQueryString {
method = GET
exclude = id,tx_ttnews[backPid]
}
returnLast = url
}
wrap = <link rel="canonical" href="|" />
}

# keep article links out of canonical urls
[globalVar = GP:tx_ttnews|cat > 0]
plugin.tx_seobasics.60.typolink.addQueryString.exclude = id,tx_ttnews[tt_news],tx_ttnews[backPid]
[global]

[globalVar = GP:tx_ttnews|tt_news > 0]
plugin.tx_seobasics.30.stdWrap >
plugin.tx_seobasics.30.data = register:newsKeywords

plugin.tx_seobasics.40.stdWrap >
plugin.tx_seobasics.40.data = register:newsSubheader
plugin.tx_seobasics.40.ifEmpty >
plugin.tx_seobasics.40.ifEmpty.cObject = RECORDS
plugin.tx_seobasics.40.ifEmpty.cObject {
dontCheckPid = 1
tables = tt_news
source.data = GPvar:tx_ttnews|tt_news
source.insertData = 1
conf.tt_news = TEXT
conf.tt_news {
field = short
ifEmpty.field = bodytext
required = 1
htmlSpecialChars = 0
crop = 150|...|1
stripHtml = 1
trim = 1
}
}
[global]
By Michael Cannon on Wednesday, December 31, 1969 11:24 PM EST
Gravatar: Michael Cannon As the code above does what I want it to do and doesn't cause the tt_news extension to spend extra cycles or time to generate a page, I've turned off the extension aqnewsmeta. I'd suggest for you to do the same.