Bug #16741

typoLink doesn't use "type" correctly with simulateStaticDocuments

Added by Oliver Hader over 14 years ago. Updated over 9 years ago.

Should have
Target version:
Start date:
Due date:
% Done:


Estimated time:
TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


Imagine a TypoScript configuration like the following and simulateStaticDocuments enabled:

page.10 = TEXT
page.10 {
stdWrap = 1
stdWrap.typolink {
returnLast = url
useCacheHash = 1
parameter.data = tsfe:id
additionalParams = &type=5

You would get something like this as link-URL:


If a user clicks that link, he isn't forward to typeNum "5" as defined, but to the regular typeNum "0". So we would expect to have a link like the following one:


The MD5-Part is missing here because it was used for the "&type=5" param only.

The attached patch file is exactly doing this by adding an additional check to tslib_cObj::typoLink.

It's not only a 4.1-beta1a issue. This exists since a long time... ;-)
(issue imported from #M4564)


patch_typolink.diff (1.38 KB) patch_typolink.diff Administrator Admin, 2006-11-27 10:35
4564_typolink_typeparam.diff (851 Bytes) 4564_typolink_typeparam.diff Administrator Admin, 2007-08-02 17:29

Related issues

Related to TYPO3 Core - Feature #16088: Adding propertie "class" for typolinkClosedBenni Mack2007-08-02


Updated by Marc Bastian Heinrichs over 14 years ago

I think this is no bug. The type can be included in the typolink.parameter property. Then simulateStatic should work correct - realurl does.
For your TS:

page.10 = TEXT
page.10 {
stdWrap = 1
stdWrap.typolink {
returnLast = url
useCacheHash = 1
parameter {
data = tsfe:id
wrap = |,5


Updated by Oliver Hader over 14 years ago

That's correct. But you're wrapping the parameter to set the type. My approach is setting - the type. So you're making a step around to do what could be done directly. Look at this as kind of HCI issue.


Updated by Thorsten Kahler over 14 years ago

The parameter "type" has a special meaning in TYPO3 and so it's handled special. It should always be set according to TSRef [1] else there are some other side effects, too.

[1] http://typo3.org/documentation/document-library/references/doc_core_tsref/4.0.0/view/5/8/


Updated by Steffen Kamper over 14 years ago

as you can see in class.tslib_content.php in function typolink, the type get's his special part in $link_param, which takes data only from parameter:

$pairParts = t3lib_div::trimExplode(',',$link_param);
if (count($pairParts)>1) {
$link_param = $pairParts0;
$theTypeP = $pairParts1; // Overruling 'type'

So in my opinion this has to added by a special parameter, like this:

10.typolink.parameter = 7

with adding one line after above mentioned code:
if($conf['type']) $theTypeP =$conf['type'];

something like this would be my suggestion. I've tested and for me works perfect.

and then there is an easy way to overrule the type fom TS or php.


Updated by Dmitry Dulepov over 14 years ago

parameter.dataWrap = {TSFE:id},5


Updated by Mario Matzulla over 14 years ago

Hi guys!

You must be kidding ;)

"Now the input can be an alias or page-id. If the input is an integer it's a page-id, if it's two comma separated integers, it's a id/type pair, else it's an alias."

This is the only passage in the TSRef which shows how to handle the type parameter. I don't consider myself a good php programmer, but I do have some knowledge about "well written code" and this is definitely something underneath loooooow level. How can you combine a parameter with another one like that if you can use multiple parameters for a function call?
Why is function($address), where $address is a csv-list, dieing out? Because today you can write it better and more user-friendly: function($name, $street, $zip, $city).

So please, consider a change of code. I know that this is not a bug, but something that could make life a lot easier.


Updated by Elmar Hinz almost 14 years ago

I vote for Steffen Kamper's solution:

10.typolink.parameter = 7

Thorsten Kahler Kahler

Where do you find something about side effects in TSRef [1] if the type is not set? Has it been removed from that page. For me the type still defaults to 1 of not set.

[1] http://typo3.org/documentation/document-library/references/doc_core_tsref/4.0.0/view/5/8/


Updated by Dmitry Dulepov almost 14 years ago

Well, while solution already exists (see my example with dataWrap), but I lik Steffen's solution too. Except that it has to be a proper patch to get into core (unified diff).


Updated by Steffen Kamper almost 14 years ago

ok, i uploaded the patch as diff.

The change is very small
was changed to
$theTypeP =$conf['type'];

Now the old way works as well, but type can be given with conf.

10 = TEXT
10.value = Standard Link

20 = TEXT
20.value = New Link
20.typolink.parameter = 3

Please check it out.


Updated by Elmar Hinz almost 14 years ago

To make the matter complete we should also think of the other values of parameter. At least the "class" attribute could be available as dedicated typolink property. The id attribute is also a candidate.

I don't want to hider the processing of this patch, so I made it an own feature request: http://bugs.typo3.org/view.php?id=6062

The other thingy is the JS popup. But that is more complex and less interesting.


Updated by Dmitry Dulepov over 9 years ago

  • Category deleted (Communication)
  • Status changed from New to Rejected
  • Target version deleted (0)
  • TYPO3 Version changed from 4.1beta1 to 4.7
  • PHP Version deleted (5)

The issue is too old. I do not think we ever will change that because lots of people use the syntax already.

Closing the issue.

Also available in: Atom PDF