Zum Inhalt springen

T3sports (cfcleague) und GIFBUILDER

Erstellt am 29. August 2008 · 3 Antworten · letzte Antwort am 10. September 2008

Tags: Frage, English

White ·

First of all, sorry for writing in English, I don’t speak German. I’m here because this board seems to be the place where T3sports is most widely discussed. But you may reply in German. 🙂
Second, sorry for still being a TS dumbass, I'm only in my second month of learning. 🙂
I’m using T3sports extensions for my first TYPO3 project, which is a football-related site.
My current objective is to create a pretty graphic frontpage teaser for the single upcoming match using GIFBUILDER. I would like to create it in TypoScript, not writing my own extension.
I added a League Management plugin, chose a favorite club and marked to display a single scheduled game. Now I have 2 problems:
1. How can I copy the data from the plugin to my own text objects that I will include in the image?
2. How can I replace the whole plugin output with the image? I managed to replace markers like ###MATCH_COMPETITION_SHORT_NAME###, but not the ###MATCH### marker itself. (Of course, I can create a suitable template, but it looks like a bad workaround).
This is the code I wrote so far (in TypoScript field of the plugin), which is supposed to write the competition short name, home and guest team names on an image, in place of short_name marker. It tries to take values using the “field:” construct, but seems to fail: all the values it gets are related to competition name, not the team names.
What am I doing wrong? And is the task technically possible?

matchtable.match {
  home.name.nameText = TEXT
  home.name.nameText.value = {field:name}
  home.name.nameText.value.insertData = 1

  guest.name.nameText = TEXT
  guest.name.nameText.value = {field:name}
  guest.name.nameText.value.insertData = 1

  competition.short_name = IMAGE
  competition.short_name.nameText = TEXT
  competition.short_name.nameText.value = {field:short_name}
  competition.short_name.nameText.value.insertData = 1

  competition.short_name.file = GIFBUILDER
  competition.short_name.file {
    XY = 400, 150
    format = png

    10 = TEXT
    10.text < matchtable.match.competition.short_name.nameText.value
    10.fontSize = 15
    10.offset = 10,35
    10.niceText = 1
    10.fontFile = fileadmin/fonts/MyriadPro-Regular.otf

    20 = TEXT
    20.text < matchtable.match.home.name.nameText.value
    20.fontSize = 15
    20.offset = 10,75
    20.niceText = 1
    20.fontFile = fileadmin/fonts/MyriadPro-Regular.otf

    30 = TEXT
    30.text < matchtable.match.guest.name.nameText.value
    30.fontSize = 15
    30.offset = 200,75
    30.niceText = 1
    30.fontFile = fileadmin/fonts/MyriadPro-Regular.otf
  }
}
digedag ·

Hi White,

what you want to do is something really complicated. This is because you have to output data from different database tables within a single picture. But I think it is possible to do! 🙂

Here is a little example that works for me:

# First we load the data from other tables
temp.preparations {
  # Let's lookup the competitions name
  comp = RECORDS
  comp {
    source.field = competition
    tables = tx_cfcleague_competition
    conf.tx_cfcleague_competition = TEXT
    conf.tx_cfcleague_competition.field = name
  }
  # Now the home team
  home = RECORDS
  home {
    source.field = home
    tables = tx_cfcleague_teams
    conf.tx_cfcleague_teams = TEXT
    conf.tx_cfcleague_teams.field = name
  }
  # for guest it is pretty the same stuff, except the field
  guest < .home
  guest.source.field = guest
}
# Now we prepare the round marker in view "matchreport". You can also use any other field, you don't need for other output.
plugin.tx_cfcleaguefe_report.matchreport.match {
  round = IMAGE
  round.file = GIFBUILDER
  round.file {
    XY = [20.w]+[25.w]+[30.w]+15,50
    backColor = #8D8BD9
    10 = TEXT
    10 {
      # here we copy the prepared RECORDS object for competition name
      text.cObject < temp.preparations.comp
      fontFile = fileadmin/fonts/journal.ttf
      fontColor = #FFFFFF
      fontSize = 24
      offset = 5,20
    }
    # The next line shows the opponents. We change the RECORD and the offset in this example.
    20 < .10
    20.text.cObject < temp.preparations.home
    20.offset = 5,40
    # A minus sign as separator
    25 < .10
    25.text >
    25.text = -
    25.offset = [20.w]+5,40
    30 < .10
    30.text.cObject < temp.preparations.guest
    30.offset = [20.w]+[25.w]+10,40
  }
}

I put this example and some more typoscript stuff to the T3sports Wiki.

White ·

Danke schön! This works fine!
But seems like if I wanna try to add my DAM-managed club logos there, I'll need a bit more tinkering...