[TYPO3-english] Template Voila - Strange duplicate container/content output with TS Object Path

Denyer denyerec at gmail.com
Thu May 26 22:17:57 CEST 2011


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">&lt;div id="c37" class="csc-default" &gt;t:&lt;a  
href="tel:+44-1522-681811"&gt;+44 (0) 1522  
681811&lt;/a&gt;&lt;/div&gt;</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.

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 inset HTML elements successfully in the past.
Kind regards,
Denyer


More information about the TYPO3-english mailing list