Die TYPO3 Mailingliste - nicht fragen: lesen!
This is a discussion on [TYPO3] TemplaVoila and IMG_RESOURCE problem within the typo3-english@lists.netfielders.de forums, part of the TYPO3-Mailinglists: ENGLISH category; Hi group, using TV in Typo3 V4.1 I'm trying to set an inline style="background-image:url(...
|
|||||||
| Registrieren | Hilfe | Benutzerliste | Kalender | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren |
|
#1
|
|||
|
|||
|
Hi group,
using TV in Typo3 V4.1 I'm trying to set an inline style="background-image:url(uploads/media/<xyz.jpg>);" but only get style="background-image:url();" The essential template setup is as follows: ----- snip ----- ### get first picture from the media field temp.bild_b1 = IMG_RESOURCE temp.bild_b1 { file.import = uploads/media/ file.import.field = media file.import.listNum = 0 stdWrap.wrap = background-image:url( | ); } lib.bild_b1 < temp.bild_b1 page = PAGE page.typeNum = 0 page.10 = USER page.10.userFunc = tx_templavoila_pi1->main_page ----- snap ----- The regarding TV DS XML is: ----- snip ----- <field_b1 type="array"> <type>attr</type> <tx_templavoila type="array"> <title>Bild 1</title> <sample_data type="array"> <numIndex index="0"></numIndex> </sample_data> <eType>TypoScriptObject</eType> <eType_EXTRA type="array"> <objPath>lib.bild_b1</objPath> </eType_EXTRA> <TypoScriptObjPath>lib.bild_b1</TypoScriptObjPath> <description>a.b1 style-Attribut</description> </tx_templavoila> </field_b1> ----- snap ----- The mapping in the TO is set to the attribute 'style' and up to date, but the generated HTML output is only: ----- snip ----- style="background-image:url();" ----- snap ----- For testing purposes I added this template setup: ----- snip ----- page.5 < lib.bild_b1 ----- snap ----- and get, directly after the <body> tag, a line: ----- snip ----- background-image:url(uploads/media/garten04.jpg); ----- snap ----- Conclusions: - my template setup for lib.bild_b1 is correct, as can be seen from the output of page.5, where the correct path to the image is spit out - my TV DS/TO/mapping seems to be OK: the wrap is generated and spit out in the correct place ... inside the quotes of the style attribute But why is the path to the picture missing, when lib.bild_b1 is used in TV as opposed to being correctly generated in page.5 ??? Any help/hint is very welcome. Thanks for your time and efforts, Georg -- ___ ___ | + | |__ Georg Rehfeld Woltmanstr. 12 20097 Hamburg |_|_\ |___ georg.rehfeld.nospam (AT) gmx (DOT) de +49 (40) 23 53 27 10 (Delete .nospam from mail address) _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#2
|
|||
|
|||
|
Georg Rehfeld schrieb:
> Hi group, > > using TV in Typo3 V4.1 I'm trying to set an inline > style="background-image:url(uploads/media/<xyz.jpg>);" but only get > style="background-image:url();" > > The essential template setup is as follows: > > ----- snip ----- > ### get first picture from the media field > temp.bild_b1 = IMG_RESOURCE > temp.bild_b1 { > file.import = uploads/media/ > file.import.field = media > file.import.listNum = 0 > stdWrap.wrap = background-image:url( | ); > } > > lib.bild_b1 < temp.bild_b1 > > page = PAGE > page.typeNum = 0 > page.10 = USER > page.10.userFunc = tx_templavoila_pi1->main_page > ----- snap ----- > > The regarding TV DS XML is: > > ----- snip ----- > <field_b1 type="array"> > <type>attr</type> > <tx_templavoila type="array"> > <title>Bild 1</title> > <sample_data type="array"> > <numIndex index="0"></numIndex> > </sample_data> > <eType>TypoScriptObject</eType> > <eType_EXTRA type="array"> > <objPath>lib.bild_b1</objPath> > </eType_EXTRA> > <TypoScriptObjPath>lib.bild_b1</TypoScriptObjPath> > <description>a.b1 style-Attribut</description> > </tx_templavoila> > </field_b1> > ----- snap ----- > > The mapping in the TO is set to the attribute 'style' and up to date, > but the generated HTML output is only: > > ----- snip ----- > style="background-image:url();" > ----- snap ----- > > > For testing purposes I added this template setup: > > ----- snip ----- > page.5 < lib.bild_b1 > ----- snap ----- > > and get, directly after the <body> tag, a line: > > ----- snip ----- > background-image:url(uploads/media/garten04.jpg); > ----- snap ----- > > > Conclusions: > > - my template setup for lib.bild_b1 is correct, as can be seen from > the output of page.5, where the correct path to the image is spit > out > > - my TV DS/TO/mapping seems to be OK: the wrap is generated and spit out > in the correct place ... inside the quotes of the style attribute > > > But why is the path to the picture missing, when lib.bild_b1 is used in > TV as opposed to being correctly generated in page.5 ??? > > Any help/hint is very welcome. > > Thanks for your time and efforts, Georg Which field do you mean with "media". If you want to to get the image in "field_b1" you should use something like "import.current = 1" or "import.field = field_b1" _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#3
|
|||
|
|||
|
Hi Georg,
> Which field do you mean with "media". This is the field "media" from the table "pages" which contains "garten04.jpg,garten05.jpg,garten06.jpg,garten07.j pg" for the page in question. In the backend this is the field labelled "Files:" in the page type "Advanced", which the author fills using the Typo3 Element Browser (Feld "Dateien:" im Seitentyp "Erweitert"). > If you want to to get the image in > "field_b1" you should use something like > > "import.current = 1" > > or > > "import.field = field_b1" I don't want to get the image in "field_b1" (there is no such field). That string is just the TemplaVoila mapping name for the style attribute of a <span> inside an <a class="b1"> tag. And as I pointed out: my TS conf for the IMG_RESOURCE _is_ OK, when used in page.5: the path to the first image file is generated. And the TV mapping is also OK, as the wrap "background-image:url();" is inserted by TV in the right place (the spans style attribute). The problem still is: in TV the path to the image file is not rendered. Why? Thanks, Georg -- ___ ___ | + | |__ Georg Rehfeld Woltmanstr. 12 20097 Hamburg |_|_\ |___ georg.rehfeld.nospam (AT) gmx (DOT) de +49 (40) 23 53 27 10 (Delete .nospam from mail address) _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#4
|
|||
|
|||
|
Georg Rehfeld wrote:
> I don't want to get the image in "field_b1" (there is no such field). > That string is just the TemplaVoila mapping name for the style attribute > of a <span> inside an <a class="b1"> tag. > > And as I pointed out: my TS conf for the IMG_RESOURCE _is_ OK, when used > in page.5: the path to the first image file is generated. > > And the TV mapping is also OK, as the wrap "background-image:url();" is > inserted by TV in the right place (the spans style attribute). > > The problem still is: in TV the path to the image file is not rendered. > Why? Because you did not read manual You can access only fields from DS on the same level if you use only field name. To access fields from parent record you have to use more complex TS. Read manual about parent record. -- 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.) _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#5
|
|||
|
|||
|
Hi George. Try changing the line:
file.import.field = media to: file.import.data = pages:media -- Peter Klein/Umloud Untd "Georg Rehfeld" <georg.rehfeld (AT) gmx (DOT) de> skrev i en meddelelse news:mailman.215563.1178926685.21067.typo3-english (AT) lists (DOT) netfielders.de... > Hi group, > > using TV in Typo3 V4.1 I'm trying to set an inline > style="background-image:url(uploads/media/<xyz.jpg>);" but only get > style="background-image:url();" > > The essential template setup is as follows: > > ----- snip ----- > ### get first picture from the media field > temp.bild_b1 = IMG_RESOURCE > temp.bild_b1 { > file.import = uploads/media/ > file.import.field = media > file.import.listNum = 0 > stdWrap.wrap = background-image:url( | ); > } > > lib.bild_b1 < temp.bild_b1 > > page = PAGE > page.typeNum = 0 > page.10 = USER > page.10.userFunc = tx_templavoila_pi1->main_page > ----- snap ----- > > The regarding TV DS XML is: > > ----- snip ----- > <field_b1 type="array"> > <type>attr</type> > <tx_templavoila type="array"> > <title>Bild 1</title> > <sample_data type="array"> > <numIndex index="0"></numIndex> > </sample_data> > <eType>TypoScriptObject</eType> > <eType_EXTRA type="array"> > <objPath>lib.bild_b1</objPath> > </eType_EXTRA> > <TypoScriptObjPath>lib.bild_b1</TypoScriptObjPath> > <description>a.b1 style-Attribut</description> > </tx_templavoila> > </field_b1> > ----- snap ----- > > The mapping in the TO is set to the attribute 'style' and up to date, > but the generated HTML output is only: > > ----- snip ----- > style="background-image:url();" > ----- snap ----- > > > For testing purposes I added this template setup: > > ----- snip ----- > page.5 < lib.bild_b1 > ----- snap ----- > > and get, directly after the <body> tag, a line: > > ----- snip ----- > background-image:url(uploads/media/garten04.jpg); > ----- snap ----- > > > Conclusions: > > - my template setup for lib.bild_b1 is correct, as can be seen from > the output of page.5, where the correct path to the image is spit > out > > - my TV DS/TO/mapping seems to be OK: the wrap is generated and spit out > in the correct place ... inside the quotes of the style attribute > > > But why is the path to the picture missing, when lib.bild_b1 is used in > TV as opposed to being correctly generated in page.5 ??? > > Any help/hint is very welcome. > > Thanks for your time and efforts, Georg > -- > ___ ___ > | + | |__ Georg Rehfeld Woltmanstr. 12 20097 Hamburg > |_|_\ |___ georg.rehfeld.nospam (AT) gmx (DOT) de +49 (40) 23 53 27 10 > > (Delete .nospam from mail address) _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#6
|
|||
|
|||
|
Dear Peter,
thanks a lot, essentially your change made it work! The only litte thing: instead of pages:media the correct syntax is page:media Peter Klein wrote: > Hi George. Try changing the line: > > file.import.field = media > > to: > > file.import.data = pages:media > Thanks, you saved me endless hours of reading more docs and experiments (I spent the whole weekend on this issue reading/experiemnting). The onyl thing left is: I really would like to understand, why page:media works, but my solution does not (as well as file.import.data = field:media does not work). Best regards, Georg -- ___ ___ | + | |__ Georg Rehfeld Woltmanstr. 12 20097 Hamburg |_|_\ |___ georg.rehfeld.nospam (AT) gmx (DOT) de +49 (40) 23 53 27 10 (Delete .nospam from mail address) _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#7
|
|||
|
|||
|
"Georg Rehfeld" <georg.rehfeld (AT) gmx (DOT) de> wrote in message
news:mailman.223272.1179160845.21067.typo3-english (AT) lists (DOT) netfielders.de... > Dear Peter, > > Thanks, you saved me endless hours of reading more docs and experiments > (I spent the whole weekend on this issue reading/experiemnting). The > onyl thing left is: > > I really would like to understand, why page:media works, but my > solution does not (as well as file.import.data = field:media does > not work). When you create a TemplaVoila object, then the scope of variables is limited to that TV object. So when you do a: 10.import.field = media TV looks for a TV FIELD named "media", so in order to get "outside" the TV object, you have to specify the table & field you want. And for that you use the "data" property instead of "field" 10.import.data = page:media (I hope i explained it correctly.) -- Peter Klein / Umloud Untd _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#8
|
|||
|
|||
|
Dear Peter,
>> I would like to understand ... > > When you create a TemplaVoila object, then the scope of variables is limited > to that TV object. Ahh! You know, that you just gave the essential abstract/concept of what is going on behind the scenes of TV? As far as I could figure, this is not stated at all (at least not clearly, or well hidden in some subordinate clause) in all TV related docs. > So when you do a: > > 10.import.field = media > > TV looks for a TV FIELD named "media", so in order to get "outside" the TV > object, you have to specify the table & field you want. And for that you use > the "data" property instead of "field" > > 10.import.data = page:media > > (I hope i explained it correctly.) I can't confirm correctness (lacking knowledge/analysis), but at least I begin to understand. And your explanation helped me a lot. Thanks again Peter, you are a good guy. best regard, Georg -- ___ ___ | + | |__ Georg Rehfeld Woltmanstr. 12 20097 Hamburg |_|_\ |___ georg.rehfeld.nospam (AT) gmx (DOT) de +49 (40) 23 53 27 10 (Delete .nospam from mail address) _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
| Themen-Optionen | Thema durchsuchen |
| Ansicht | Thema bewerten |
|
|
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| [TYPO3-templavoila] templavoila header problem | Roelof Wobben | typo3-project-templavoila@lists.netfielders.de | 2 | 27.03.2007 12:31 |
| [TYPO3-templavoila] TV Problem with XML | Mike Morris | typo3-project-templavoila@lists.netfielders.de | 3 | 16.02.2007 15:29 |
| [TYPO3-dev] Type "stdWrap" for IMG_RESOURCE.minW and .minH | Joerg Wagner | typo3-dev@lists.netfielders.de | 0 | 08.02.2007 05:41 |
| [TYPO3-templavoila] little mapping problem | Witt Elias | typo3-project-templavoila@lists.netfielders.de | 1 | 31.01.2007 11:46 |
| [TYPO3-templavoila] little mapping problem | Witt Elias | typo3-project-templavoila@lists.netfielders.de | 0 | 31.01.2007 11:16 |