[TYPO3] TEXT data property
Stephen Bungert
s.bungert at metrinomics.de
Mon Apr 21 14:25:50 CEST 2008
That worked really well! Thanks very much. I had been looking at the
imgResource section had not noticed import. Thanks again.
-----Ursprüngliche Nachricht-----
Von: typo3-english-bounces at lists.netfielders.de
[mailto:typo3-english-bounces at lists.netfielders.de] Im Auftrag von
Christopher Torgalson
Gesendet: Montag, 21. April 2008 14:10
An: TYPO3 English
Betreff: Re: [TYPO3] TEXT data property
Hi,
On Mon, Apr 21, 2008 at 1:59 PM, Stephen Bungert
<s.bungert at metrinomics.de> wrote:
> I have used the following to get the path to an image in a content
element.
>
> temp.cotwImg = TEXT
> temp.cotwImg.data = DB : tt_content : 94 : image_link
>
> I then build a a GMENU and and IMAGE object.
>
> temp.cotw = COA
>
> temp.cotw {
>
> 10 = HMENU
>
> 10.special = directory
> 10.special.value = 157
> 10.maxItems = 1
>
> 10.1 = GMENU
>
> # menu code
>
> 30 = IMAGE
> 30.file < temp.cotwImg.data
> 30.file.width = 200
> 30.file.height = 100
> 30.wrap = <tr><td id="cotwImage" valign="top">|</td></tr>
> }
>
> I can see the G-MENU object, but the line 30.file < temp.cotwImg.data
> doesn't seem to load an image.
>
> If I just output temp.cotwImg.data I see a path to an image (starting
with
> fileadmin/...). Why doesn't 30.file except temp.cotwImg.data as a file
path?
It's in the TSref--but you have to learn how to look for it. The IMAGE
cObject's .file property has the datatype 'imgResource,' [1] so to see
how to use it the way you're trying to do, you'll have to check the
imgResource function in the TSref [2].
It's not explicitly stated in the TSref, but IMAGE expects its file
property to return a path to a file, so what you have to do is look at
the imgResource function to see where (or if!) you can use stdWrap to
return a function like you're doing above.
It turns out that imgResource has a property called .import that seems
well-suited to the job, and it has stdWrap. So, something like this
should work:
30.file.import.data = DB : tt_content : 94 : image_link
[Untested, but should be enough for you to fix any bugs I accidentally
put in...]
If you're interested in a longer treatment of how to use the TSref,
try http://www.typo3apprentice.com/howto/rtfm/
--
Christopher Torgalson
http://www.typo3apprentice.com/
[1]
http://typo3.org/documentation/document-library/references/doc_core_tsref/cu
rrent/view/8/6/
[2]
http://typo3.org/documentation/document-library/references/doc_core_tsref/cu
rrent/view/5/2/
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.netfielders.de
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
More information about the TYPO3-english
mailing list