Advanced linkgeneration

Sometimes you have the problem that you need links which keeps certain parameters. Typical this is the case if you need a printlink.

Therefore you can use a function in the extension "danp_libs". With this function you have all options of the TYPO3 datatyp "typolink" plus some additonal ones:

 

policy

Values: "all" = keeps all actual parameters.
 "none" = no parameters

explicitDeny

relevant for policy all. A comma seperated list of paremeters which should not be kept

explicitAllow

relevant for policy none. A comma seperated list of paremeters which should be kept

linktext
linktextCObject

The text which should be linked (as text or Content-Object)

additionalParamsCObject

A content object which can be used for additional parameters

 

Example printlink for news

lib.printlink =USER
lib.printlink {
  linkText=Druckversion
  userFunc=tx_danplibs_pi1->link
  parameter.data=TSFE:id
  policy=none
 explicitAllow=tx_ttnews[tt_news],plugin[param1],plugin[param2]  
  useCacheHash=1
  no_cache=0   
  additionalParams=&print=1
}

 

Example link which keeps all parameters

lib.printlinkurlall =USER
lib.printlinkurlall {
  userFunc=tx_danplibs_pi1->link
  parameter.data=TSFE:id
  policy=all 
  useCacheHash=0
  no_cache=1
  returnLast=url   
  additionalParams=&print=1
}

 

Samplelink for tip-a-friend


lib.tipafriend=USER
lib.tipafriend {
   userFunc=tx_danplibs_pi1->link
  parameter=29
  returnLast=url
  additionalParamsCObject=COA
  additionalParamsCObject {
    2=TEXT
    2.value=&tipUrl=

    10=TEXT
    10.data=getIndpEnv:TYPO3_REQUEST_URL
    10.rawUrlEncode=1
  }

  stdWrap.wrap=< href="|" ...

}

blog comments powered by Disqus
blogroll