Discussion:
[TYPO3] Using subtitle in template
Edwin Blokker
2006-10-16 11:07:58 UTC
Permalink
Hello,

I want to use the pages subtitle as a text in my template. I use this
typoscript:

# subtitle
lib.sub = TEXT
lib.sub {
value = domain.com
value.override.field = subtitle
value.wrap = domain.com: |
}

And have tried many variations on this one, but none of them show any
result. What am I doing wrong?

BTW, I'm new to typoscript, I hope questions like this are appropriate
on this list. I could not find a special 'newbie list'.

Thanks in advance,
Edwin.
Dmitry Dulepov
2006-10-16 11:20:54 UTC
Permalink
Hi!
Post by Edwin Blokker
I want to use the pages subtitle as a text in my template. I use this
# subtitle
lib.sub = TEXT
lib.sub {
value = domain.com
value.override.field = subtitle
value.wrap = domain.com: |
}
And have tried many variations on this one, but none of them show any
result. What am I doing wrong?
You are trying to get subtitle from tt_content but you need pages table.
So try:
value.override.data = page:subtitle
Post by Edwin Blokker
BTW, I'm new to typoscript, I hope questions like this are appropriate
on this list. I could not find a special 'newbie list'.
It is ok, support is here, in this list.
--
Dmitry Dulepov

Web: http://typo3bloke.net/
Skype: callto:liels_bugs

"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)
Edwin Blokker
2006-10-16 11:42:54 UTC
Permalink
Hi,
Post by Dmitry Dulepov
Hi!
Post by Edwin Blokker
I want to use the pages subtitle as a text in my template. I use this
# subtitle
lib.sub = TEXT
lib.sub {
value = domain.com
value.override.field = subtitle
value.wrap = domain.com: |
}
And have tried many variations on this one, but none of them show any
result. What am I doing wrong?
You are trying to get subtitle from tt_content but you need pages table.
value.override.data = page:subtitle
Thanks. I have just tried this, and when viewing the page, it just shows
'domain.com', it isn't overwritten with the subtitle. The page I'm
viewing does have a subtitle.
Post by Dmitry Dulepov
Post by Edwin Blokker
BTW, I'm new to typoscript, I hope questions like this are appropriate
on this list. I could not find a special 'newbie list'.
It is ok, support is here, in this list.
Ok, thanks!
Matthew Manderson
2006-10-16 11:53:26 UTC
Permalink
Post by Edwin Blokker
Thanks. I have just tried this, and when viewing the page, it just shows
'domain.com', it isn't overwritten with the subtitle. The page I'm
viewing does have a subtitle.
Edwin

There is an example of this in the wonderful document called TypoScript By
Example

http://typo3.org/documentation/document-library/core-documentation/doc_core_tsbyex/current/view/4/2/

Matthew
Edwin Blokker
2006-10-16 12:58:24 UTC
Permalink
Post by Matthew Manderson
Post by Edwin Blokker
Thanks. I have just tried this, and when viewing the page, it just shows
'domain.com', it isn't overwritten with the subtitle. The page I'm
viewing does have a subtitle.
Edwin
There is an example of this in the wonderful document called TypoScript By
Example
http://typo3.org/documentation/document-library/core-documentation/doc_core_tsbyex/current/view/4/2/
Matthew
Thanks matthew. I have already read that tutorial, and tried a script
like that, but it didn't work.
JoH asenau
2006-10-16 11:56:00 UTC
Permalink
Post by Dmitry Dulepov
Post by Edwin Blokker
I want to use the pages subtitle as a text in my template. I use this
# subtitle
lib.sub = TEXT
lib.sub {
value = domain.com
value.override.field = subtitle
value.wrap = domain.com: |
}
And have tried many variations on this one, but none of them show any
result. What am I doing wrong?
You are trying to get subtitle from tt_content but you need pages
value.override.data = page:subtitle
"value" doesn't offer stdWrap properties in TEXT elements.
So this is the correct syntax:

lib.sub = TEXT
lib.sub {
value = domain.com
override.field = subtitle
override.wrap = domain.com: |
}


but then you might run into problems since the wrap will make the override
always happen even if the field subtitle is empty so I guess it would be
better to do it like this:

lib.sub = COA
lib.sub {
wrap = domain.com|
10 = TEXT
10.dataWrap = : {field:subtitle}
10.fieldRequired = subtitle
}

HTH

Joey
--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com
Edwin Blokker
2006-10-16 13:00:45 UTC
Permalink
Thanks Joey,

I tried both codes, but they both only render the wrap, without the
subtitle. Could there be something else I'm doing wrong??
Post by JoH asenau
Post by Dmitry Dulepov
Post by Edwin Blokker
I want to use the pages subtitle as a text in my template. I use this
# subtitle
lib.sub = TEXT
lib.sub {
value = domain.com
value.override.field = subtitle
value.wrap = domain.com: |
}
And have tried many variations on this one, but none of them show any
result. What am I doing wrong?
You are trying to get subtitle from tt_content but you need pages
value.override.data = page:subtitle
"value" doesn't offer stdWrap properties in TEXT elements.
lib.sub = TEXT
lib.sub {
value = domain.com
override.field = subtitle
override.wrap = domain.com: |
}
but then you might run into problems since the wrap will make the override
always happen even if the field subtitle is empty so I guess it would be
lib.sub = COA
lib.sub {
wrap = domain.com|
10 = TEXT
10.dataWrap = : {field:subtitle}
10.fieldRequired = subtitle
}
HTH
Joey
JoH asenau
2006-10-16 15:06:00 UTC
Permalink
Post by Edwin Blokker
Post by JoH asenau
Post by Dmitry Dulepov
Post by Edwin Blokker
I want to use the pages subtitle as a text in my template. I use
# subtitle
lib.sub = TEXT
lib.sub {
value = domain.com
value.override.field = subtitle
value.wrap = domain.com: |
}
And have tried many variations on this one, but none of them show
any result. What am I doing wrong?
You are trying to get subtitle from tt_content but you need pages
value.override.data = page:subtitle
"value" doesn't offer stdWrap properties in TEXT elements.
lib.sub = TEXT
lib.sub {
value = domain.com
override.field = subtitle
override.wrap = domain.com: |
}
but then you might run into problems since the wrap will make the
override always happen even if the field subtitle is empty so I
lib.sub = COA
lib.sub {
wrap = domain.com|
10 = TEXT
10.dataWrap = : {field:subtitle}
10.fieldRequired = subtitle
}
I tried both codes, but they both only render the wrap, without the
subtitle. Could there be something else I'm doing wrong??
It seems you are not in the correct "scope" to get the field "subtitle".
It is a field of the pages table. So I assumed you are rendering this field
while rendering other stuff of the pages data array.
If you try do get the subtitle field while rendering elements from other
tables (like i.e. tt_content) you have to do it like Dmitry already
mentioned:

10.dataWrap = : {page:subtitle}

Should be working then.

Joey
--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com
Edwin Blokker
2006-10-17 11:18:32 UTC
Permalink
Post by JoH asenau
It seems you are not in the correct "scope" to get the field "subtitle".
It is a field of the pages table. So I assumed you are rendering this field
while rendering other stuff of the pages data array.
If you try do get the subtitle field while rendering elements from other
tables (like i.e. tt_content) you have to do it like Dmitry already
10.dataWrap = : {page:subtitle}
Should be working then.
Joey
Thanks for all the input, but I can't get any of the typoscript to work.
I'm new to typoscript (I have read the basic tutorials), and am not very
familiar with scopes.

Here is what I did: I mapped <h1> tags using templavoila as editing
type: typoscript object path. I then added the typoscript to my template
just like I did for the menu's (which are working fine).
Edwin Blokker
2006-10-18 14:11:05 UTC
Permalink
I still have not figured out what I'm doing wrong.. The Typoscripts I
have used (as suggested here) seem right, but still it's just not
working. I only get the first part of the wrap, I can't access the
subtitle field for some reason.. Any further suggestions would be
appreciated.

Loading...