Zen TYPO3 Forum

Our TYPO3 forum is available for freelancers, professionals and clients new to TYPO3 to discuss Basic TYPO3 templating, Typoscript, extension installation, administration and help with subscription templates. Please register for an account to post.

All Categories > TYPO3 General Discussion > Templates > Zenlight Pro with multiple domains
Total Posts: 2 - Pages (1): [1]
Author: mediatech
Posted: Jun 11 2007 - 03:32 PM
Subject: re: Zenlight Pro with multiple domains
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]-->

)


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
}
}


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
}
}


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 -->


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
}


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
Author: debugger_systems
Posted: Jun 11 2007 - 10:57 AM
Subject: Zenlight Pro with multiple domains
Hi again, I will be using the zenlight pro template for multiple sites on my server. I have read the bit in Typo3:s "getting started" about multiple domains and it seems pretty straightforward. You point all CNAMES to your webserver, define the virtual sites in apache and point them to the typo3-dummy directory, create all the sites in the typo3 backend tree and choose new->domain to define which address should lead to which typo3 site.

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. Right now I have 2 sites, let's call them superbusiness.com and ubergeekforum which use the zenlight pro template. Since they both use the content in /var/lib/typo3-dummy/fileadmin/themes/zlightpro/ ...

http://www.superbusiness.com/fileadmin/themes/zlightpro/images/masthead.jpg
and
http://www.ubergeekforum.com/fileadmin/themes/zlightpro/images/masthead.jpg

..will be the same. How can I solve it so that all multiple sites can use the same templates but still be able to change background, logo etc. individually? 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"

Matti Jääaro
Total Posts: 2 - Pages (1): [1]
You must login to post a message to this conference.

 

CHC Forum provided by Cast Iron Coding

TYPO3 Support