[TYPO3] realurl, typolinks and parameters (generally)

Paul Vetch paul at qedstudio.com
Sun Jun 18 16:58:52 CEST 2006


Hi Peter,

Many thanks for that.  I've got a working solution from your suggestion,
albeit I encountered another prob on the way which I had to hack around:


Because I need myparam to be appended to all the links on a page, I have
myparam listed in config.linkVars.  It seems that config.linkVars
overrides absolutely anything done to a typolink: so, although your
method worked beautifully with myparam removed from config.linkVars,
when it's there, nothing happens at all (the split just doesn't do
anything, so I assume linkVars is processed after ts).

So my dreadful hacked solution for now - unless you can see something
really wrong with it - is to apply exactly your method, but to get the
(realurl) path as an environmental variable and bypass typolink
altogether:

config.linkVars = myparam
...
10 = TEXT
#10.value = http://mypath/to/myparam.html
10.data = getenv : REQUEST_URI
10.split {
    token = /
    cObjNum = 1 |*||*| 2
    1.current = 1
    1.wrap = |/
  }
10.wrap = Stripped URL:&nbsp;|<br>

This works, but it seems pretty dirty to me and I may be missing a very
obvious and nasty drawback... 

Best wishes

Paul







-----Original Message-----
From: Peter Klein [mailto:peter at umloud.dk] 
Posted At: 17 June 2006 12:16
Posted To: typo3.english
Conversation: [TYPO3] realurl, typolinks and parameters (generally)
Subject: Re: [TYPO3] realurl, typolinks and parameters (generally)

Hi Paul. How about something like this?

-- cut --
  10 = TEXT
  #10.value = http://mypath/to/myparam.html
  10.typolink.parameter.field = uid
  10.typolink.returnLast = url
  10.split {
    token = /
    cObjNum = 1 |*||*| 2
    1.current = 1
    1.wrap = |/
  }
  10.wrap = Stripped URL:&nbsp;|<br>
-- cut --

---
Peter  Klein / Umloud Untd

"Paul Vetch" <paul at qedstudio.com> wrote in message 
news:mailman.1.1150533623.2898.typo3-english at lists.netfielders.de...
> Hi,
>
> My question yesterday was way too specific so in the hope someone can
> help / has seen this problem before, I've tried to generalise it a
bit.
> I'm sure there must be a way to achieve this, and that I'm being
stupid.
> Situation is:
>
> * I want to use a global variable.  I add an additionalParam to a
> typolink
> additionalParams = &myParam=1
> * I setup RealURL to hide it in part of the URL (as a filename) -
> http://mypath/to/myparam.html
> * I can test whether the variable is set using globalVar GP: etc. - no
> problem.
>
> If I then want to *unset* the parameter, I need a way of getting it
out
> of the RealURL so that I can generate a typolink with an HREF of:
>
> http://mypath/to/
>
> If I'm on a page with a RealURL path of http://mypath/to/myparam.html
> then the returnLast = url method will always include the
'myparam.html'
> which I don't want.
>
> Question is how can I generate a Typolink *without parameters* in a
> RealURL context?
> 






More information about the TYPO3-english mailing list