[TYPO3] select tt_address fields for template; finally figured it out!
Finees Mendez
fineesmendez at yahoo.com
Sat May 24 18:27:03 CEST 2008
I need to have my clients control their own company info (i.e. address, email, phone, etc.). So why not tt_address. It is simple to use, and you can even access the records from the "Web>>Page" module. The following TS reads from the tt_address table where the record is stored. Here I have used a mix of div's & tables to manipulate the output. Here is a working sample of the TS: http://www.enlacesnupciales.com ; Please note, by the time of this posting, the site is yet to be completed. I hope this can helps some of you. Keep TS-ing!
Improvements I still need to make: create an image for the company name to match the company's logo fonts, etc.
# Company Address Info Output
#######################################
page.1 {
subparts.CONTACTS = CONTENT
subparts.CONTACTS {
table = tt_address
select.pidInList = 33 ###### Where the tt_address record is stored
select.where = uid = 4 ###### Just in case there is more than one record, select the one you want
select.max = 1
renderObj = COA
wrap = |
renderObj.10 = COA
renderObj.10.wrap = <div id="header-left"> <div id="company-logo"> | </div> </div>
renderObj.10.1 = CTABLE
renderObj.10.1 {
tableParams = class="logo-table" border="0" cellspacing="0" cellpadding="0"
offset = 0,0
lm.1 = IMAGE
lm.1.wrap = <h1> | </h1> ###### In case images are turn off, use this for styling
lm.1.border = 0
lm.1.altText.field = company
lm.1.titleText.field = company
lm.1.longdescURL.field = description
lm.1.file.import = uploads/pics/ ###### Where the uploaded images are stored
lm.1.file.import.field = image
lm.1.file.width = 89
lm.1.file.height = 67
lm.1.stdWrap.typolink.parameter.field = www
lm.1.stdWrap.typolink.title.field = company
lm.1.if.isTrue.field = image
lm.TDParams = class="logo-image"
rm.1 = TEXT
rm.1.innerWrap = <h1> | </h1>
rm.1.field = company
rm.1.typolink.parameter.field = www
rm.1.typolink.title.field = company
rm.1.if.isTrue.field = company
rm.TDParams = class="logo-text"
}
renderObj.20 = COA
renderObj.20.wrap = <div id="header-right"> <div id="cc-box"> <div id="company-contacts"> | </div> </div> </div>
renderObj.20.1 = CTABLE
renderObj.20.1 {
tableParams = width="100%" border="0" cellspacing="0" cellpadding="0"
offset = 0,0
# Left table cell
lm.1 = TEXT
lm.1.value = Address
lm.TDParams = width="34%" class="cc-header small bold uppercase address"
# Center table cell
c.1 = TEXT
c.1.value = Contacts
c.TDParams = width="32%" class="cc-header small bold uppercase contacts"
# Right table cell
rm.1 = TEXT
rm.1.value = Online
rm.TDParams = width="34%" class="cc-header small bold uppercase online"
}
renderObj.20.2 = CTABLE
renderObj.20.2 {
tableParams = width="100%" border="0" cellspacing="0" cellpadding="0"
offset = 0,0
# left table cell
lm.1 = COA
lm.1.wrap = <p> | </p>
lm.1.1 = TEXT
lm.1.1.wrap = | <br />
lm.1.1.field = address
lm.1.1.if.isTrue.field = address
lm.1.2 = TEXT
lm.1.2.wrap = | ,
lm.1.2.field = building
lm.1.2.if.isTrue.field = building
lm.1.3 = TEXT
lm.1.3.wrap = Suite: | <br />
lm.1.3.field = room
lm.1.3.if.isTrue.field = room
lm.1.4 = TEXT
lm.1.4.wrap = | ,
lm.1.4.field = city
lm.1.4.if.isTrue.field = city
lm.1.5 = TEXT
lm.1.5.wrap = | <br />
lm.1.5.field = region
lm.1.5.if.isTrue.field = region
lm.1.6 = TEXT
lm.1.6.wrap = |
lm.1.6.field = zip
lm.1.6.if.isTrue.field = zip
lm.1.7 = TEXT
lm.1.7.wrap = |
lm.1.7.field = country
lm.1.7.if.isTrue.field = country
lm.TDParams = width="34%" valign="top" class="cc-content small"
# center table cell
c.1 = COA
c.1.wrap = <p> | </p>
c.1.1 = TEXT
c.1.1.wrap = | <span class="bold"> Office</span> <br />
c.1.1.field = phone
c.1.1.if.isTrue.field = phone
c.1.2 = TEXT
c.1.2.wrap = | <span class="bold"> Fax</span> <br />
c.1.2.field = fax
c.1.2.if.isTrue.field = fax
c.1.3 = TEXT
c.1.3.wrap = | <span class="bold"> Mobile</span>
c.1.3.field = mobile
c.1.3.if.isTrue.field = mobile
c.TDParams = width="32%" valign="top" class="cc-content small"
# right table cell
rm.1 = COA
rm.1.wrap = <p> | </p>
rm.1.1 = TEXT
rm.1.1.wrap = | <br />
rm.1.1.field = email
rm.1.1.typolink.parameter.field = email
rm.1.1.typolink.title = Send Us an Email Now!
rm.1.1.if.isTrue.field = email
rm.1.2 = TEXT
rm.1.2.field = www
rm.1.2.typolink.parameter.field = www
rm.1.2.typolink.title = Make this site your Home page
rm.1.2.if.isTrue.field = www
rm.TDParams = width="34%" valign="top" class="cc-content small"
}
}
}
More information about the TYPO3-english
mailing list