[TYPO3] Question about multiple contents' positions...

Andreas Burg typo3 at andreasburg.de
Wed Jul 30 22:11:01 CEST 2008


Efstathios Papadopoulos schrieb:
> Hi there,
> 
> I'm sure that there is a way, but I'm still newbie with TS and I cant 
> find how to do:
> 
> I have a template with multiple "div" sections.
> How can I control in which div will the content be placed, each time I 
> add some content? Do I have to add extra script in the Setup for every 
> piece of content, or is there a way to choose it at the posting time?
> 
> Thanx a lot!
> 
> 
> 
> 
> 

Hi Efstathios,

HTML-Template example ->
...snip...
<div id="cont1">###CONT1###</div>
<div id="cont2">###CONT2###</div>
...snip...

###YOURNAME### = Template Markers
---

In TYPO3 you can create one TS-Template for the content from your columns "header" and so on. Every 
column has a colPos and a name. You can add, remove, rename or sort your columns in BE later, when 
you're more familiar with. But watch the colPos regarding to the name of the column. ->

lib.cont1 < styles.content.get
lib.cont1.select.where = colPos = 0
# this is putting the content from a column into an object. "lib" is more or less free, "cont1" is free

lib.cont2 < styles.content.get
lib.cont2.select.where = colPos = 1
# and the content from another column
---

Now you can create a TS-Template which build the page ->

# the name "page" is free given, but recommended for beware of conflicts with later installed, not 
clean programmed, extensions.
page = PAGE
page {
   typeNum = 0

# the "10" below is a free integer, but recommended first
   10 = TEMPLATE
   10.template = FILE
   10.template.file = fileadmin/your_html_template_with_markers_in_it.html

# here you put the content from the columns into your Template Markers using the objects created above
   10.marks {
     CONT1 =< lib.cont1
     CONT2 =< lib.cont2
   }
}

Thats it. Information you can all find in TSref. A good english tutorial for beginners is 
recommended. Sorry just knew a good german tutorial.

Keep on

Andreas


More information about the TYPO3-english mailing list