[Typo3] TS:better solution?

Christopher bedlamhotel at gmail.com
Thu Dec 15 18:21:25 CET 2005


On 12/15/05, Nikolas Hagelstein <hagelstein at hauptsache.net> wrote:
> Hi,
> > You're not really answering the question, and that makes it hard to
> > provide useful suggestions.
> I am sorry what exactly is your question?
>
> >What is _wrong_ with the way you're doing now
> nothing i just seems a little long winded to me.
> I wonder if there isn't a more direct way to
> access the img properties instead of taking the
> TSFE-register detour. you know?
>
>
> > You could, for example, rebuild the object you show above as a
> > COA; would that be better in some way?
> hmm possible you provide more detailed information on that?
>

You're trying to achieve this link:

<a href="#"
     onMouseOver="
     show('prj_{register:PRJCounter}');
     changeimg('img_{register:PRJCounter}','{register:img_org}')"
     onMouseOut="
     hide('prj_{register:PRJCounter}');
     changeimg('img_{register:PRJCounter}','{register:img}');">Foo</a>

...right?

You _could_ do the same as a cObject--though it's still pretty
long-winded. The advantage is that you can use .stdWrap properties for
your link attributes, which is something you can't do with ATagParams.
Simplified example:

lib.jsLink = COA
lib.jsLink {
  ### open the tag and create the 'href' attribute:
  5 = HTML
  5 {
    value {
      typolink {
        parameter = path/to/file/
        returnLast = url
      }
      noTrimWrap = |<a href="|" |
    }

    ### create the changeimg attribute (simplified here):
    10 = HTML
    10 {
      value {
        cObject = IMG_RESOURCE
        cObject {
          ### code for image generation, retrieval or whatever here
        }

        dataWrap = changeimg('img_{register:PRJCounter}','|');">
      }
    }

    ### add link text and closing tag:
    15 = HTML
    15 {
      value = Foo
      value.wrap = |</a>
    }
  }
}

...and so on...


-Christopher



More information about the TYPO3-english mailing list