[TYPO3] additional parans in typolink...

Christopher Torgalson bedlamhotel at gmail.com
Tue Apr 17 00:51:10 CEST 2007


Hi,

On 4/16/07, Andrew Davis <andrew at avagraphique.com> wrote:
> Hi, I am trying to make a link for the tip a friend extension, which i
> have setup and seems to work.
>
> my link generates, but the additionalParams d not get added to the url.
> I am using REALURL but that shouldn't make a difference should it?
>
>
>
>
> temp.tip = TEXT
> temp.tip.value = Email a friend
> temp.tip.typolink{
>    parameter=36
>    additionalParams{
>     10 = TEXT
>     10.value = &tipUrl=
>     20 = TEXT
>     20.data = getIndpEnv: TYPO3_REQUEST_URL
>    }
>
> }
>
>
>
>
> I poked around the newsgroups and read the typolink page
> http://typo3.org/documentation/document-library/references/doc_core_tsref/4.0.0/view/5/8/
>
> but i think im missing something...
>
> any help much appreciated



You ARE missing something: the datatype of additional params--it's
/string/ NOT stdWrap (which it would have to be in order for what
you've tried to work).

The way to do what you're trying is to use typolink to retrieve ONLY
the url, and to add your parameters to it afterwards--it's a bit ugly,
but it will work:

temp.tip = COA
temp.tip {
  # Build the opening a tag:
  5 = COA
  5 {
    wrap = |<a href="|">|

    # Start the link:
    5 = TEXT
    5 {
      typolink {
        parameter = 36
        returnLast = url
      }
    }

    # Get the next parameter:
    10 = TEXT
    10 {
      dataWrap = &tipUrl={getIndpEnv:TYPO3_REQUEST_URL}
    }
  }

  # Write the link text and close the tag:
  10 = TEXT
  10 {
    value = Email a friend
    wrap = |</a>
  }
}

If you don't understand datatypes in the TSref, you may want to read
my short article about using the TSref:
http://typo3apprentice.com/howto/rtfm/

-- 
Christopher Torgalson
http://www.typo3apprentice.com/


More information about the TYPO3-english mailing list