Discussion:
[TYPO3-english] Mapping Content Element Containers with TypoScript
Dayle Rees
2010-10-12 11:15:05 UTC
Permalink
Hi list,

I am currently experimenting with creating templates using TYPOSCRIPT
rather than TemplaVoila, the documentation on this topic seems a little
distributed and sparse, so I was wondering if someone could help me with
my last problem!

I have the following extension template as part of the site :

# <HEAD> Inclusions Overwrite
page.headerData.10 = TEXT
page.headerData.10.value (
<link rel="stylesheet" type="text/css"
href="fileadmin/templates/addysg/resources/turbine/css.php?files=childrens.cssp"
media="all" />
)

# Include main template for childrens section.
page.50 = TEMPLATE
page.50.template = FILE
page.50.template.file =
fileadmin/templates/addysg/templates/childrens_content.html

as you can see this extension template is pulling in a different CSS
file to the main template ( I tried using includeCSS but nothing was
outputted :( ) and a simple call to a template file which sits in the
middle of templates that are further up on the template hierarchy. This
is all wonderful and works fantastically, what I would like to know is
how to map one of the markers '###MAIN_CONTENT###' in
'childrens_content.html' to be a container for content elements, so that
contributors may input data using the back end.

In TemplaVoila this is done using the clickety click mapping feature,
would anyone be able to show me how this is done using TYPOSCRIPT.

I don't think I am using anything version specific here, but I am using
the latest build of 4.4 if that helps at all.

If you would like any more information please let me know :)

Thanks again list!
Dayle.
--
Dayle Rees BSc MCP

Rhaglennydd Datblygu'r We Web Applications Developer
Isadran Cyfrifiaduron Computer Section
Llyfrgell Genedlaethol Cymru National Library of Wales
Aberystwyth, Aberystwyth
Ceredigion, Ceredigion
SY23 3BU SY23 3BU

Ff?n / Phone: 01970 632425 Ffacs / Fax: 01970 632425
EBost / Email: dayle.rees at llgc.org.uk We / Web: http://www.llgc.org.uk
-----------------------------------------------------------------------
Yn siarad drosof fy hun, nid o anghenrheidrwydd y LlGC - Speaking personally, not necessarily for NLW
Dayle Rees
2010-10-12 11:42:05 UTC
Permalink
Post by Dayle Rees
Hi list,
I am currently experimenting with creating templates using TYPOSCRIPT
rather than TemplaVoila, the documentation on this topic seems a
little distributed and sparse, so I was wondering if someone could
help me with my last problem!
# <HEAD> Inclusions Overwrite
page.headerData.10 = TEXT
page.headerData.10.value (
<link rel="stylesheet" type="text/css"
href="fileadmin/templates/addysg/resources/turbine/css.php?files=childrens.cssp"
media="all" />
)
# Include main template for childrens section.
page.50 = TEMPLATE
page.50.template = FILE
page.50.template.file =
fileadmin/templates/addysg/templates/childrens_content.html
as you can see this extension template is pulling in a different CSS
file to the main template ( I tried using includeCSS but nothing was
outputted :( ) and a simple call to a template file which sits in the
middle of templates that are further up on the template hierarchy.
This is all wonderful and works fantastically, what I would like to
know is how to map one of the markers '###MAIN_CONTENT###' in
'childrens_content.html' to be a container for content elements, so
that contributors may input data using the back end.
In TemplaVoila this is done using the clickety click mapping feature,
would anyone be able to show me how this is done using TYPOSCRIPT.
I don't think I am using anything version specific here, but I am
using the latest build of 4.4 if that helps at all.
If you would like any more information please let me know :)
Thanks again list!
Dayle.
Have tried :

page.50.marks.MAIN_CONTENT = TEXT
page.50.marks.MAIN_CONTENT < styles.content.get

with some content elements in the 'normal' column, however no output :(.
--
Dayle Rees BSc MCP

Rhaglennydd Datblygu'r We Web Applications Developer
Isadran Cyfrifiaduron Computer Section
Llyfrgell Genedlaethol Cymru National Library of Wales
Aberystwyth, Aberystwyth
Ceredigion, Ceredigion
SY23 3BU SY23 3BU

Ff?n / Phone: 01970 632425 Ffacs / Fax: 01970 632425
EBost / Email: dayle.rees at llgc.org.uk We / Web: http://www.llgc.org.uk
-----------------------------------------------------------------------
Yn siarad drosof fy hun, nid o anghenrheidrwydd y LlGC - Speaking personally, not necessarily for NLW
JoH asenau
2010-10-12 11:51:24 UTC
Permalink
Post by Dayle Rees
page.50.marks.MAIN_CONTENT = TEXT
^^^^^^^^^^
Post by Dayle Rees
page.50.marks.MAIN_CONTENT < styles.content.get
Should be just

page.50.marks.MAIN_CONTENT < styles.content.get

for markers or

page.50.subparts.MAIN_CONTENT < styles.content.get

for subparts. But this will only work with the CSS-styled-content static included.

To make sure that the markers/subparts are replaced with anything, you could try the TEXT element like this:

page.50.marks.MAIN_CONTENT = TEXT
page.50.marks.MAIN_CONTENT.value = It works!

or

page.50.subparts.MAIN_CONTENT = TEXT
page.50.subparts.MAIN_CONTENT.value = It works!

HTH

Joey
--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com
Dayle Rees
2010-10-12 11:57:32 UTC
Permalink
Post by JoH asenau
Post by Dayle Rees
page.50.marks.MAIN_CONTENT = TEXT
^^^^^^^^^^
Post by Dayle Rees
page.50.marks.MAIN_CONTENT< styles.content.get
Should be just
page.50.marks.MAIN_CONTENT< styles.content.get
for markers or
page.50.subparts.MAIN_CONTENT< styles.content.get
for subparts. But this will only work with the CSS-styled-content static included.
page.50.marks.MAIN_CONTENT = TEXT
page.50.marks.MAIN_CONTENT.value = It works!
or
page.50.subparts.MAIN_CONTENT = TEXT
page.50.subparts.MAIN_CONTENT.value = It works!
HTH
Joey
It works, thank you Joey!

Would you happen to know how to add custom / more columns, since NORMAL
LEFT RIGHT BORDER may not be enough for my needs.

Thanks again,
Dayle.
--
Dayle Rees BSc MCP

Rhaglennydd Datblygu'r We Web Applications Developer
Isadran Cyfrifiaduron Computer Section
Llyfrgell Genedlaethol Cymru National Library of Wales
Aberystwyth, Aberystwyth
Ceredigion, Ceredigion
SY23 3BU SY23 3BU

Ff?n / Phone: 01970 632425 Ffacs / Fax: 01970 632425
EBost / Email: dayle.rees at llgc.org.uk We / Web: http://www.llgc.org.uk
-----------------------------------------------------------------------
Yn siarad drosof fy hun, nid o anghenrheidrwydd y LlGC - Speaking personally, not necessarily for NLW
JoH asenau
2010-10-12 12:32:13 UTC
Permalink
Post by Dayle Rees
Would you happen to know how to add custom / more columns, since
NORMAL LEFT RIGHT BORDER may not be enough for my needs.
To add them to the backend you can use TSconfig or extTables.php
After all colPos is just a field that gets rendered as a selectbox.
i.e. you can use this page TSconfig:

TCEFORM.tt_content.colPos.addItems {
4 = My New Column
5 = Another Column
}

The only difference between them will be the colPos used to fetch the content.

styles.content.get

uses colPos 0 within the select of the CONTENT element. The others use 1,2 and 3.
So you just have to make sure to add new columns and change the colPos in the TS accordingly.

HTH

Joey
--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com
Dayle Rees
2010-10-12 13:11:52 UTC
Permalink
Post by JoH asenau
Post by Dayle Rees
Would you happen to know how to add custom / more columns, since
NORMAL LEFT RIGHT BORDER may not be enough for my needs.
To add them to the backend you can use TSconfig or extTables.php
After all colPos is just a field that gets rendered as a selectbox.
TCEFORM.tt_content.colPos.addItems {
4 = My New Column
5 = Another Column
}
The only difference between them will be the colPos used to fetch the content.
styles.content.get
uses colPos 0 within the select of the CONTENT element. The others use 1,2 and 3.
So you just have to make sure to add new columns and change the colPos in the TS accordingly.
HTH
Joey
Hmm, thanks again for your reply, however adding the TS above to the
page 'setup' gives me no new columns, even after a clear cache, sorry to
be a bother Joey, I am really grateful for all this help!
--
Dayle Rees BSc MCP

Rhaglennydd Datblygu'r We Web Applications Developer
Isadran Cyfrifiaduron Computer Section
Llyfrgell Genedlaethol Cymru National Library of Wales
Aberystwyth, Aberystwyth
Ceredigion, Ceredigion
SY23 3BU SY23 3BU

Ff?n / Phone: 01970 632425 Ffacs / Fax: 01970 632425
EBost / Email: dayle.rees at llgc.org.uk We / Web: http://www.llgc.org.uk
-----------------------------------------------------------------------
Yn siarad drosof fy hun, nid o anghenrheidrwydd y LlGC - Speaking personally, not necessarily for NLW
JoH asenau
2010-10-12 13:20:33 UTC
Permalink
Post by Dayle Rees
Hmm, thanks again for your reply, however adding the TS above to the
page 'setup' gives me no new columns, even after a clear cache, sorry
to be a bother Joey, I am really grateful for all this help!
It's page TSconfig.
This has nothing to do with the TypoScript Setup in your template but is a textarea you can find in the "options" tab when editing the page itself.
It will activate the setting for alle subpages as well, so you should put it into the TSconfig area of your root page.

Take a look at the core docs at typo3.org to find out more about TypoScript and TSconfig.

HTH

Joey
--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com
JoH asenau
2010-10-12 11:54:36 UTC
Permalink
Post by Dayle Rees
as you can see this extension template is pulling in a different CSS
file to the main template ( I tried using includeCSS but nothing was
outputted :( )
page.includeCSS will work with array keys like these:

page.includeCSS {
your_first_key_here = fileadmin/whatever.css
your_second_key_here = fileadmin/something.css
}

And it will only work as long as you have TYPO3 generate the header.
So when you disabled the header code via config or page.config, includeCSS won't work anymore.

HTH

Joey
--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com
Dayle Rees
2010-10-12 12:04:10 UTC
Permalink
Post by JoH asenau
Post by Dayle Rees
as you can see this extension template is pulling in a different CSS
file to the main template ( I tried using includeCSS but nothing was
outputted :( )
page.includeCSS {
your_first_key_here = fileadmin/whatever.css
your_second_key_here = fileadmin/something.css
}
And it will only work as long as you have TYPO3 generate the header.
So when you disabled the header code via config or page.config, includeCSS won't work anymore.
HTH
Joey
Thanks again Joey, oddly this doesn't work, I have tried :

page.includeCSS {
file1 = fileadmin/templates/addysg/resources/turbine/css.php?files=home.cssp
}

in the primary (highest) template setup, and it doesn't appear in the
head, the rest of the typo3 generated stuff appears there nicely though!
PS I know the path to the css file looks a bit odd, but its cos I'm
using a css preprocessor, have tried with a static css file and the
output is the same.

Very strange indeed!
--
Dayle Rees BSc MCP

Rhaglennydd Datblygu'r We Web Applications Developer
Isadran Cyfrifiaduron Computer Section
Llyfrgell Genedlaethol Cymru National Library of Wales
Aberystwyth, Aberystwyth
Ceredigion, Ceredigion
SY23 3BU SY23 3BU

Ff?n / Phone: 01970 632425 Ffacs / Fax: 01970 632425
EBost / Email: dayle.rees at llgc.org.uk We / Web: http://www.llgc.org.uk
-----------------------------------------------------------------------
Yn siarad drosof fy hun, nid o anghenrheidrwydd y LlGC - Speaking personally, not necessarily for NLW
bernd wilke
2010-10-13 23:52:11 UTC
Permalink
Post by JoH asenau
page.includeCSS {
file1 =
fileadmin/templates/addysg/resources/turbine/css.php?files=home.cssp }
in the primary (highest) template setup, and it doesn't appear in the
head, the rest of the typo3 generated stuff appears there nicely though!
PS I know the path to the css file looks a bit odd, but its cos I'm
using a css preprocessor, have tried with a static css file and the
output is the same.
as you have URL-paramters you need to define the external-flag:
from TSRef:
.external - If set, there is no file existence check. Useful for
inclusion of external files.

as there is no file named 'css.php?files=home.cssp' you need to define
external:

page.includeCSS.file1.external = 1


bernd
--
http://www.pi-phi.de/cheatsheet.html
Loading...