debugger_systems wrote:
The thing I don't get however, is how to use the same template for different sites but still be able to control stuff like the banners, background and all the other content that is hard coded into the html-files.
The design elements for HTML templates 1column.html, 2column.html, 3column.html, home2column.html are controlled by 1 CSS file layout.css located in fileadmin/templates/templatename/css/layout.css. layout.css is responsible for background images, the masthead and other design elements like character spacing, header styles, colors, etc.
If you want to share these HTML files between multiple sites there are several options. If you just need to change a few things like the masthead and some colors this can be done through over riding ID and Class Styles in layout.css with a Page StyleSheet Selector.
OPTION 1: Page StyleSheet Selectors
I recommend the Advanced Page Stylesheet Selection extension which offers the option of recursive selection pages or a single page in your page tree. The Page StyleSheet Selector extension is also good but does not have as many options.
Example:
If superbusiness.com uses masthead.jpg and you want to use a different header for ubergeekforum.com like masthead2.jpg then create a CSS file like ubergeekforum.css and use the Page StyleSheet Selector extension to assign a new masthead like this.
#masthead{background: url(../images/masthead2.jpg) 0 0 no-repeat;}
You can continue to add other alternative styles like this.
#header {background: url(../images/background2.gif) 0 0 repeat;}
OPTION 2: TypoScript
If you need many changes done to the template(s) and/or CSS file(s) and option 1 becomes too difficult to maintain you can simply alter the TypoScript for each web site to point to a different template folder.
You can change the template folder path in the following lines. Do a find/replace on the document so you don't miss any folder names if you are changing the template folder name or location.
# Template Selector
#######################################
plugin.tx_rlmptmplselector_pi1 {
templatePathMain = fileadmin/templates/zwire/
defaultTemplateFileNameMain = 2column.html
inheritMainTemplates = 1
}
# Setting up 'page' to be the default PAGE object (type=0)
#######################################
page.includeCSS {
file1 = fileadmin/templates/zwire/css/layout.css
file2 = fileadmin/templates/zwire/css/ADxMenu.css
}
page.headerData.10 = TEXT
page.headerData.10.value (
<!--[if lte IE 6]>
<style type="text/css" media="screen, tv, projection">
@import "/fileadmin/templates/zwire/css/ie6.css";
</style>
<script type="text/javascript" src="/fileadmin/templates/zwire/scripts/ADxMenu.js"></script>
<![endif]-->
)
#######################################
plugin.tx_rlmptmplselector_pi1 {
templatePathMain = fileadmin/templates/zwire/
defaultTemplateFileNameMain = 2column.html
inheritMainTemplates = 1
}
# Setting up 'page' to be the default PAGE object (type=0)
#######################################
page.includeCSS {
file1 = fileadmin/templates/zwire/css/layout.css
file2 = fileadmin/templates/zwire/css/ADxMenu.css
}
page.headerData.10 = TEXT
page.headerData.10.value (
<!--[if lte IE 6]>
<style type="text/css" media="screen, tv, projection">
@import "/fileadmin/templates/zwire/css/ie6.css";
</style>
<script type="text/javascript" src="/fileadmin/templates/zwire/scripts/ADxMenu.js"></script>
<![endif]-->
)
TYPOSCRIPT HTML MARKERS
Each HTML file contains HTML markers that are replaced with dynamic content from the TypoScript located in the files scripts/TSsetup-ADxMenu.txt, TSsetup-ADxMenu.noext.txt, etc.
If you want to extend or remove the number of extensions that appear on each template globally you can do so by adding or removing the HTML TypoScript markers.
HTML TypoScript markers are useful for globally populating an extension rather than having to manually insert the extension on many pages as is often the case for banner ads, member login fields, search field, etc.
Creating markers can be fairly easy if you locate the TypoScript for that extension which is in its own extension folder.
Example:
Simple Banner Extension
The extension TypoScript is typically located in a file such as ext_typoscript_setup.txt for each TYPO3 extension. Somtime you have to do a little digging. If you visit the TYPO3 Extension Repository you can locate where these TypoScript files are. By default extensions use files such as ext_typoscript_setup.txt or setup.txt for their default configuration options and ext_typoscript_constants.txt for default values. Values like {$SimpleBanner.AbsolutePath} are overridden in Web > Template > Info/modify > Constants: TypoScript Constants.
A new TypoScript HTML marker will look something like this.
page.1 {
subparts.MY_NEW_MARKER < plugin.tx_dedivbanner_pi1
subparts.MY_NEW_MARKER = TEXT
subparts.MY_NEW_MARKER {
AbsolutePath = {$SimpleBanner.AbsolutePath}
TitleAlt = {$SimpleBanner.TitleAlt}
CloseAlt = {$SimpleBanner.CloseAlt}
Style {
TableBgColor = {$SimpleBanner.Style.TableBgColor}
HeaderBgColor = {$SimpleBanner.Style.HeaderBgColor}
}
timeOut = {$SimpleBanner.timeOut}
rotateTitle = {$SimpleBanner.rotateTitle}
CMD = {$SimpleBanner.CMD}
pidList = {$SimpleBanner.pidList}
recursive = {$SimpleBanner.recursive}
left = {$SimpleBanner.left}
top = {$SimpleBanner.top}
{$SimpleBanner.AllowClose} AllowClose = 1
{$SimpleBanner.warning} warning = 1
{$SimpleBanner.NoLayer} NoLayer = 1
}
}
subparts.MY_NEW_MARKER < plugin.tx_dedivbanner_pi1
subparts.MY_NEW_MARKER = TEXT
subparts.MY_NEW_MARKER {
AbsolutePath = {$SimpleBanner.AbsolutePath}
TitleAlt = {$SimpleBanner.TitleAlt}
CloseAlt = {$SimpleBanner.CloseAlt}
Style {
TableBgColor = {$SimpleBanner.Style.TableBgColor}
HeaderBgColor = {$SimpleBanner.Style.HeaderBgColor}
}
timeOut = {$SimpleBanner.timeOut}
rotateTitle = {$SimpleBanner.rotateTitle}
CMD = {$SimpleBanner.CMD}
pidList = {$SimpleBanner.pidList}
recursive = {$SimpleBanner.recursive}
left = {$SimpleBanner.left}
top = {$SimpleBanner.top}
{$SimpleBanner.AllowClose} AllowClose = 1
{$SimpleBanner.warning} warning = 1
{$SimpleBanner.NoLayer} NoLayer = 1
}
}
You can also hard code the values found in the ext_typoscript_constants.txt file and use only what you need like this.
# My new TypoScript marker
#######################################
page.1 {
subparts.MY_NEW_MARKER < plugin.tx_dedivbanner_pi1
subparts.MY_NEW_MARKER = TEXT
subparts.MY_NEW_MARKER {
AbsolutePath = mybanner/file
TitleAlt = Some title
CloseAlt = Close
timeOut = 14000
rotateTitle = Another title
CMD = rotate
pidList = 22
}
}
#######################################
page.1 {
subparts.MY_NEW_MARKER < plugin.tx_dedivbanner_pi1
subparts.MY_NEW_MARKER = TEXT
subparts.MY_NEW_MARKER {
AbsolutePath = mybanner/file
TitleAlt = Some title
CloseAlt = Close
timeOut = 14000
rotateTitle = Another title
CMD = rotate
pidList = 22
}
}
Now you can place the following TS HTML marker into 1column.html, 2column.html, 3column.html, etc. like this.
<!-- ###MY_NEW_MARKER### START -->
<!-- ###MY_NEW_MARKER### END -->
<!-- ###MY_NEW_MARKER### END -->
There are several ways to create TS markers including more advanced options. For these you will need to learn more TypoScript.
For example if you want to add a Printlink to every page that uses an image icon one or more of your templates you would do something like this.
# Cron print link
#######################################
print = PAGE
print.includeCSS {
file1 = fileadmin/templates/zmicro/css/ext/print.css
}
print {
typeNum = 98
bodyTag = <body onload="parent.self.print();">
10 = TEXT
20 < styles.content.get
}
page.1 {
subparts.PRINT < plugin.tx_cronprintlink_pi1
subparts.PRINT.linkContent = TEXT
subparts.PRINT.linkContent.value = <img
src="fileadmin/templates/zmicro/images/printer.gif" alt="Printable version"
title="Printable version" height="12" width="16" border="0" style="border-width:0px;" />
Print
}
#######################################
print = PAGE
print.includeCSS {
file1 = fileadmin/templates/zmicro/css/ext/print.css
}
print {
typeNum = 98
bodyTag = <body onload="parent.self.print();">
10 = TEXT
20 < styles.content.get
}
page.1 {
subparts.PRINT < plugin.tx_cronprintlink_pi1
subparts.PRINT.linkContent = TEXT
subparts.PRINT.linkContent.value = <img
src="fileadmin/templates/zmicro/images/printer.gif" alt="Printable version"
title="Printable version" height="12" width="16" border="0" style="border-width:0px;" />
}
debugger_systems wrote:
It would look a bit strange if all the sites I set up with the zenlight pro template had the logo "ZENLIGHTPRO seo typo3 template"
Yes, I forgot to remove ZENLIGHTPRO
You can edit the PNG file here zlightpro/images/png_source/masthead-zlightpro2.png and resave using Adobe Fireworks. I will fix soon for people who do not have Adobe Fireworks.
Gregory Remington
Mediatech Consulting, Inc.
Phone : +1 (760) 525-1770 . Fax: +1 (760) 542-1990 . Skype: gremington