Include css & js in header:
Setup.TS
page.includeJS {
file1 = fileadmin/templates/public/templates_files/file.js
}
page.includeCSS {
file1 = fileadmin/templates/public/templates_files/file.css
}
Include css & js in header:
Setup.TS
page.includeJS {
file1 = fileadmin/templates/public/templates_files/file.js
}
page.includeCSS {
file1 = fileadmin/templates/public/templates_files/file.css
}
Typo3 4.7.7
usergroup that we want to redirect to another page: 6.
pageID for target: 100.
Setup.TS
[usergroup=6]
config >
config.additionalHeaders = Location: /index.php?id=100
page >
page = PAGE
page.10 = TEXT
page.10.value=No Access!
[global]
Sometimes we need to create menus or list of items that are not strictly reflecting the current page-structure.
Using “special” property of hierarchical menus (HMENU) we can change the way menu is generated.
special = directory
special.value = 1
Setting HMENUs “special” property to “directory” enables us to create new menu from pages (and their child pages) selected in special.value property (e.g. special.value = 100, 101, 102). If no value is specified, default pid is the current page.
lib.folder_links = HMENU
lib.folder_links{
special = directory
special.value = 1 # id of parent item
1 = TMENU
1 {
wrap = <ul class="link">|</ul>
expAll = 1
NO.wrapItemAndSub = <li>|</li>
ACT < .NO
ACT = 1
ACT.ATagParams = class="active"
}
}
special property of hierarchical menus can have these values: “directory” / “list” / “updated” / “browse” / “rootline” / “keywords” / language and they are explained in detail on http://wiki.typo3.org/TSref/HMENU.
Setup.TS
# breadcrums
lib.breadcrums=COA
lib.breadcrums {
10 = HMENU
10 {
special = rootline
special.range = 1|-1
# "not in menu pages" should show up in the breadcrumbs menu
includeNotInMenu = 1
1 = TMENU
# no unneccessary scripting.
1.noBlur = 1
# Current item should be unlinked
1.CUR = 1
1.target = _self
1.wrap = <div class="breadcrumb-class">|</div>
1.NO {
stdWrap.field = title
ATagTitle.field = nav_title // title
linkWrap = ||*| > |*|
}
# Current menu item is unlinked
1.CUR {
stdWrap.field = title
linkWrap = ||*| > |*|
doNotLinkIt = 1
}
}
}
Setup.TS
page.meta {
keywords.field = keywords
keywords.ifEmpty (
List your keywords....
)
description.field = description
description.ifEmpty (
Enter some page meta description...
)
copyright.field = copyright
copyright.ifEmpty (
Enter some copyright meta description...
)
}
This will end up as HTML:
<meta name="keywords" content="List your keywords...." />
<meta name="description" content="Enter some page meta description..." />
<meta name="copyright" content="Enter some copyright meta description..." />
in <head> part of HTML document…
Alternatively this can be achieved using pages headerData:
# Meta Keywords
page.headerData.10 = TEXT
page.headerData.10.insertData=1
page.headerData.10.case=lower
page.headerData.10.wrap =
page.headerData.10.value = List your keywords....
# Meta Description
page.headerData.20 = TEXT
page.headerData.20.insertData=1
page.headerData.20.wrap =
page.headerData.20.value = Enter some page meta description...
# Meta Copyright
page.headerData.30 = TEXT
page.headerData.30.insertData=1
page.headerData.30.wrap =
page.headerData.30.value = Enter some copyright meta description...
First of all we need to add new rendering option to templavoila plugin:
Setup.TS
TCEFORM.tx_templavoila_tmplobj.rendertype.addItems.mobile = Mobile version
Afterwards, create a new sub-templates for desired pages (admin backend).
We can detect users agent with Typo3 built-in conditions:
[useragent= agent]
Check if useragent is mobile:
[useragent = *iPhone*] || [useragent = *iPod*] || [useragent = *iPad*] || [useragent = *Android*] || [useragent = *OperaMini*] || [useragent = *BlackBerry*]
Setup.TS
[useragent = *iPhone*] || [useragent = *iPod*] || [useragent = *iPad*] || [useragent = *Android*] || [useragent = *OperaMini*] || [useragent = *BlackBerry*]
# if it's mobile, set childtemplate to mobile
plugin.tx_templavoila_pi1.childTemplate = mobile
page = PAGE
page >
page = PAGE
page.10 = USER
page.10.userFunc = tx_templavoila_pi1->main_page
#name of child template
page.10.childTemplate = mobile
#change doctype and encoding
page.config >
page.config {
#output will be utf-8
renderCharset = utf-8
#doctype for mobile devices will be XHTML MP 1.0
doctype (
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd" >
)
}
[else]
page = PAGE
page.10 = USER
page.10.userFunc = tx_templavoila_pi1->main_page
[END]
while you’re at it you might want to change your menu layout to include different navigation. This will create menu from pages that have pageID 199 as their parent:
Setup.TS
[useragent = *iPhone*] || [useragent = *iPod*] || [useragent = *iPad*] || [useragent = *Android*] || [useragent = *OperaMini*] || [useragent = *BlackBerry*]
lib.mainMenu = HMENU
lib.mainMenu{
special = directory
special.value = 199
1 = TMENU
1 {
wrap = <ul class="menu">|</ul>
expAll = 1
NO.wrapItemAndSub = <li><div class="someclass">|</div></li>
ACT < .NO
ACT = 1
ACT.ATagParams = class="active"
}
}
[global]
and you should change template files of various plugins…