[TYPO3-templavoila] Strange duplicate HTML output for RECORD content - Help Needed!
Denyer
denyerec at gmail.com
Sun May 29 12:26:00 CEST 2011
(Reposting from typo3.english to a more specific group)
Evening all!
Got a really odd problem that I cannot seem to resolve. Typo 4.5.0 with TV
1.5.5
I have the following HTML markup in my main template:
<span id="header_phone">0123456789</span>
I create a mapping to this span, type INNER, object type "Typoscript
Object Path" with the name 'tv.headerPhone'
So far, so good. I see it behave as you would expect, so when I view my
site I see:
<span id="header_phone"></span>
I now go to my TS Setup and enter:
tv.headerPhone = CONTENT
tv.headerPhone {
table = tt_content
select {
pidInList = 45
uidInList = 37
}
}
This references a content element of type HTML which contains only the
following information:
t:<a href="tel:+44-1522-681811">+44 (0) 1522 681811</a>
Now when I clear caches and view on the frontend I see:
<span id="header_phone"></span>
<div id="c37" class="csc-default">
<span id="header_phone">t:<a href="tel:+44-1522-681811">+44 (0)
1522 681811</a></span>
</div>
What seems to have happened, is that the content has somehow come out
after the mapped element. Just to investigate I ran the output through HSC
to see what came out :
<span id="header_phone"><div id="c37" class="csc-default" >t:<a
href="tel:+44-1522-681811">+44 (0) 1522
681811</a></div></span>
As you can see, in this case the element has not been repeated.
The base template HTML is 100% valid with no errors. The DS/TO are all
automatically generated with no manual editing. I have deleted and
re-created the mapping and receive exactly the same result. When I use the
following TS I see what I expect:
tv.headerPhone = TEXT
tv.headerPhone.value = HELLO WORLD
So I believe it's something to do with the CONTENT element type, but I've
hit a dead end and despite trying everything I could think of, I have so
far been unable to resolve the issue.
UPDATE:
I am using the latest CSC include in my template. When I change this out
for CSC v3.8, the problem goes away. When I use any v4.x version of CSS
Styled Content, the problem appears. It also only seems to appear when the
content type is RECORD, but the tt_content.html{} typoscript in CSC3.8 and
CSC4.x is the same, so I'm unsure where to look next.
Finally, I tried setting the wrapping type to OUTER and tried the
following TS:
tv.headerPhone = CONTENT
tv.headerPhone {
table = tt_content
select {
pidInList = 45
uidInList = 37
}
wrap = <span id="header_phone">|</span>
}
This produces identical output to the first configuration:
<span id="header_phone"></span>
<div id="c37" class="csc-default">
<span id="header_phone">t:<a href="tel:+44-1522-681811">+44 (0)
1522 681811</a></span>
</div>
Can anyone help? I've exhausted all of my usual ideas, and I've been using
this method to insert HTML elements successfully in the past.
Kind regards,
Denyer
More information about the TYPO3-project-templavoila
mailing list