[TYPO3] Try to use a IF in IMG_RESOURCE construct

Andre Dittmar typo3 at hotbytes.de
Thu May 8 09:48:16 CEST 2008


Hello dear list,

I use the following code for a graphical headline. I want to achieve  
that:
- The backend-user enters a subtitle, the subtitle will be rendered as  
a grapical headline
- Optional, the backend-user may select a static graphic as a new  
field in the page properties. So this should be used instead of the  
subtitle, if such a graphic exists.

Now if a static graphic exists, it will be shown. But unfortunately,  
the subtitle isn't considered if no static graphic exists. It must be  
the "if"-part in the code, I guess. If I set the if in the first part  
for the subtitle, it will always show a subtitle (as far at is exists)  
and never the static graphic.

I already tried it with a CASE-construct, but it doesn't work  
either... :-/ Maybe someone has an idea about that?

---

page.5 = LOAD_REGISTER
page.5 {
  adRegisterHeadline.cObject = COA
  adRegisterHeadline.cObject {
    10 = IMG_RESOURCE
    10 {
      stdWrap.wrap = style="background-image:url(|);"
      file = GIFBUILDER
      file {
        XY = [10.w]+4,[10.h]+4
        backColor = #888888
        transparentBackground = 0
        10 = TEXT
        10 {
          text.data = page:subtitle
          text.case = upper
          fontSize = 20px
          fontFile = fileadmin/fonts/UniversLTStd-Cn.otf
          fontColor = #F3F3F3
          offset = 0,20
          niceText = 1
        }
      }
    }
    10 {
      if.isTrue.field = tx_salmetextpages_graph_headline
      stdWrap.wrap = style="background-image:url(|);"
      file >
      file {
        import = uploads/tx_salmetextpages/
        import.field = tx_salmetextpages_graph_headline
      }
      required = 1
    }
  }
}

---


Thanks and best regards,
Andre

---
Andre Dittmar | hot bytes

Elbinger Straße 24
74226 Nordheim
Germany

Fon : +49 (0) 71 33 / 20 46 43
Fax : +49 (0) 71 33 / 20 46 42
D1  : +49 (0) 1 60 / 97 22 03 03

Web : http://www.hotbytes.de
Mail: mail at hotbytes.de


Rechtliche Angaben:
--------------------------------
Geschäftsführer: Andre Dittmar
Gerichtsstand:   Amtsgericht Heilbronn a.N.



More information about the TYPO3-english mailing list