Cheatography
https://cheatography.com
Basic TypoScript etc. for creating a new TYPO3 Website.
Constants: Basic Constants
domain |
To globally change your domain (to go live for example) |
protocol |
Globally change your protocol. e.g. from http:// to https:// |
fileadmin |
change the basic path to your fileadmin directory (fileadmin/old_files to fileadmin/new_files) |
TypoScript: Basic Configuration
config {
doctype = html5
xmlprologue = none
baseURL = {$protocol}://{$domain}
language = de
locale_all = german
htmlTag_langKey = de
sys_language_uid = 0
# Add L Parameter to links
linkVars := addToList(L)
uniqueLinkVars = 1
# Enable ReaURL
tx_realurl_enable = 1
# Decide for yourself
moveJsFromHeaderToFooter = 0
# AdminPanel on
admPanel = 1
# Pagetitle off
noPageTitle = 2
# Spam-Protection - choose your favorite method
spamProtectEmailAddresses = ascii
} |
|
|
Typoscript: Change Website Title
page.headerData {
10 = TEXT
10 {
field = title
noTrimWrap = |<title>| - Website</title>|
}
} |
config.noPageTitle = 2
is mandatory
TypoScript: Fav Icon
page.shortcutIcon = {$fileadmin}/favicon.ico |
TypoScript: Language Condition
[globalVar = GP:L = 1]
config.sys_language_uid = 1
config.language = en
config.locale_all = english
config.htmlTag_langKey = en
[global] |
TypoScript: Add Meta-Tag "viewport"
page.meta.viewport = width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no |
TypoScript: Canocial-Tag
page.headerData.930 = TEXT
page.headerData.930 {
typolink {
parameter = {page:uid}
parameter.insertData = 1
useCacheHash = 1
addQueryString = 1
addQueryString.method = GET
addQueryString.exclude = id,no_cache,tt_news[backPid]
returnLast = url
}
wrap = <link rel="canonical" href="{$protocol}://{$domain}|" />
} |
|
|
TypoScript: Backend Layout
page.10 = FLUIDTEMPLATE
page.10 {
# Use the constants in your tpls
variables {
domain = TEXT
domain.value = {$domain}
protocol = TEXT
protocol.value = {$protocol}
fileadmin = TEXT
fileadmin.value = {$fileadmin}
# e.g. for anchor urls
typo3_request_url = TEXT
typo3_request_url.data = getIndpEnv: TYPO3_REQUEST_URL
}
file.stdWrap.cObject = CASE
file.stdWrap.cObject {
key.data = levelfield:-1, backend_layout_next_level, slide
key.override.field = backend_layout
# default template file
default = TEXT
default.value = {$fileadmin}/tpl/default.html
2 = TEXT
2.value = {$fileadmin}/tpl/alt_one.html
3 = TEXT
3.value = {$fileadmin}/tpl/alt_two.html
}
} |
|
Created By
Metadata
Favourited By
Comments
achjaderleon, 13:05 20 Nov 12
Please feel free to tell me what your would like to see in this cheat sheet. I am going to extend it from time to time with new or better typoscript solutions.
shan 12:06 14 Feb 14
Thanks
Can we add css/js include via typoscript ? (includeCSS,includeJS )
Also add other meta tags like, author, keywords,description, robots,X-UA-Compatible ..etc
bodyTagAdd ??
Thanks
Sybille, 08:42 26 Sep 19
You cheat sheet has been linked on the official TYPO3 page https://docs.typo3.org/m/typo3/docs-cheatsheets/master/en-us/CheatSheets.html#cheat-sheets.
We would like to restrict the list to only the cheat sheets that are up to date for the respective version (you can switch to the other versions by clicking "Related links in menu bottom left").
It would be great if you could create a seperate cheat sheet for each major version (7.6, 8.7, 9.5, 10...) or alternatively a "one fits all" which marks things as outdated that are no longer in current LTS (9.5).
Please feel free to contact us on Slack in #typo3-documentation, see https://typo3.org/community/teams/documentation/#c9886
Sybille Peters (TYPO3 Documentation Team)
Add a Comment
Related Cheat Sheets