TYPO3Jack.net - Das TYPO3 Mailinglist Forum Archiv

Die TYPO3 Mailingliste - nicht fragen: lesen!

[TYPO3] TemplaVoila and IMG_RESOURCE problem

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(...


Zurück   TYPO3Jack.net - Das TYPO3 Mailinglist Forum Archiv > TYPO3-Mailinglists: ENGLISH > typo3-english@lists.netfielders.de

Registrieren Hilfe Benutzerliste Kalender Suchen Heutige Beiträge Alle Foren als gelesen markieren
  #1  
Alt 12.05.2007, 01:37
Georg Rehfeld
Gast
 
Beiträge: n/a
Standard [TYPO3] TemplaVoila and IMG_RESOURCE problem

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #2  
Alt 12.05.2007, 10:05
Georg Großberger
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] TemplaVoila and IMG_RESOURCE problem

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #3  
Alt 13.05.2007, 00:54
Georg Rehfeld
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] TemplaVoila and IMG_RESOURCE problem

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #4  
Alt 14.05.2007, 09:57
Dmitry Dulepov
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] TemplaVoila and IMG_RESOURCE problem

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #5  
Alt 14.05.2007, 10:31
Peter Klein
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] TemplaVoila and IMG_RESOURCE problem

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #6  
Alt 14.05.2007, 18:40
Georg Rehfeld
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] TemplaVoila and IMG_RESOURCE problem, SOLUTION

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #7  
Alt 14.05.2007, 20:09
Peter Klein
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] TemplaVoila and IMG_RESOURCE problem, SOLUTION

"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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #8  
Alt 15.05.2007, 04:41
Georg Rehfeld
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] TemplaVoila and IMG_RESOURCE problem, SOLUTION

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
 

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an


Ähnliche Themen

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


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:39 Uhr.


Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39