Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Classes/Service/UrlService.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

namespace B13\SeoBasics\Controller;
namespace B13\SeoBasics\Service;

/***************************************************************
* Copyright notice - MIT License (MIT)
Expand Down
142 changes: 83 additions & 59 deletions Configuration/TypoScript/setup.txt
Original file line number Diff line number Diff line change
@@ -1,80 +1,104 @@
####################
#### SEO BASICS ####
####################
plugin.tx_seobasics >
plugin.tx_seobasics = COA
plugin.tx_seobasics {

# Append a line break for every header tag
5 = TEXT
5.value (


)
5.char = 10

# Building the page title
10 = TEXT
10.data = page:tx_seo_titletag // page:title
10.trim = 1
10.stdWrap.stdWrap.append = TEXT
10.stdWrap.stdWrap.append.data = TSFE:tmpl|sitetitle
10.stdWrap.stdWrap.append.trim = 1
10.stdWrap.stdWrap.append.required = 1
10.stdWrap.stdWrap.append.if.isTrue = {$plugin.tx_seo.titleWrapAppendSiteTitle}
10.stdWrap.stdWrap.append.noTrimWrap = | - ||
10.stdWrap.noTrimWrap = {$plugin.tx_seo.titleWrap}
10.stdWrap.insertData = 1
10.htmlSpecialChars = 1
10.wrap = <title>|</title>
10.append < .5

20 < .10
20.wrap = <meta name="title" content="|" />
10 = TEXT
10 {
data = page:tx_seo_titletag // page:title
trim = 1
stdWrap.stdWrap.append = TEXT
stdWrap.stdWrap.append.data = TSFE:tmpl|sitetitle
stdWrap.stdWrap.append.trim = 1
stdWrap.stdWrap.append.required = 1
stdWrap.stdWrap.append.if.isTrue = {$plugin.tx_seo.titleWrapAppendSiteTitle}
stdWrap.stdWrap.append.noTrimWrap = | - ||
stdWrap.noTrimWrap = {$plugin.tx_seo.titleWrap}
stdWrap.insertData = 1
htmlSpecialChars = 1
wrap = <title>|</title>
append = TEXT
append.char = 10
}

# Building the canonical tag
60 = TEXT
60 < .10
60 {
data >
stdWrap >

# Building the Keywords tag
30 = TEXT
30 < .10
30.data = page:keywords
30.stdWrap.noTrimWrap = {$plugin.tx_seo.keywordsWrap}
30.stdWrap.stdWrap >
30.required = 1
30.wrap = <meta name="keywords" content="|" />
cObject = USER
cObject.userFunc = B13\SeoBasics\Service\UrlService->getCanonicalUrl
#cObject.useDomain = current
required = 1
if.isTrue = {$plugin.tx_seo.enableCanonicalTag}
wrap = <link rel="canonical" href="|" />
append = TEXT
append.char = 10
}
}

##############
#### PAGE ####
##############
page {
meta {
# Building the page title
title < plugin.tx_seobasics.10
title {
wrap >
}

# Building the Description tag
40 = TEXT
40 < .30
40.data = page:description
40.stdWrap.noTrimWrap = {$plugin.tx_seo.descriptionWrap}
40.wrap = <meta name="description" content="|" />
# Building the description tag
description {
override.field = description
stdWrap.noTrimWrap = {$plugin.tx_seo.descriptionWrap}
stdWrap.stdWrap >
required = 1
}

# Building the keywords tag
keywords {
override.field = keywords
stdWrap.noTrimWrap = {$plugin.tx_seo.keywordsWrap}
stdWrap.stdWrap >
required = 1
}

# Building the date tag (last changed)
50 = TEXT
50 < .10
50.data = page:SYS_LASTCHANGED // page:crdate
50.date = Y-m-d
50.stdWrap >
50.wrap = <meta name="date" content="|" />
# Building the date tag (last changed)
date = TEXT
date {
override.field = date
data = page:SYS_LASTCHANGED // page:crdate
date = Y-m-d
stdWrap >
}
}

# Building the canonical tag
60 = TEXT
60 < .10
60.data >
60.cObject = USER
60.cObject.userFunc = B13\SeoBasics\Service\UrlService->getCanonicalUrl
#60.cObject.useDomain = current
60.required = 1
60.if.isTrue = {$plugin.tx_seo.enableCanonicalTag}
60.stdWrap >
60.wrap = <link rel="canonical" href="|" />
# Activate SEO in main "page." configuration
headerData.776 = < plugin.tx_seobasics
}


# activate SEO in main "page." configuration
config.noPageTitle = 2
page.headerData.776 = < plugin.tx_seobasics
################
#### CONFIG ####
################
config {
# Disabled <title> tag because we render it on our own
noPageTitle = 2
}


# Include sitemap.xml
###############
### SITEMAP ###
###############
tx_seo_xmlsitemaps = PAGE
tx_seo_xmlsitemaps {
typeNum = 776
Expand All @@ -85,4 +109,4 @@ tx_seo_xmlsitemaps {
10 = USER
10.userFunc = B13\SeoBasics\Controller\SitemapController->renderXMLSitemap
10.resolveMainShortcut = 1
}
}