{"id":173,"date":"2010-07-16T08:29:26","date_gmt":"2010-07-16T08:29:26","guid":{"rendered":"https:\/\/www.taywa.ch\/blog\/?p=173"},"modified":"2010-08-02T17:05:28","modified_gmt":"2010-08-02T17:05:28","slug":"bildlink-falsch-mehrere-bilder-links-typo3","status":"publish","type":"post","link":"https:\/\/www.taywa.ch\/blog\/typo3\/typoscript\/bildlink-falsch-mehrere-bilder-links-typo3\/","title":{"rendered":"Bug: Erster Bildlink falsch\/zuf\u00e4llig bei mehreren Bildern mit Links bei Typo3 4.4.0"},"content":{"rendered":"<hr \/>\n<p><strong>Update:<\/strong><br \/>\nDas Problem ergibt sich nur, wenn f\u00fcr zuf\u00e4llige Hintergrundbilder der folgende Patch\/XCLASS verwendet wird:<br \/><a href=\"http:\/\/bugs.typo3.org\/view.php?id=3557\">http:\/\/bugs.typo3.org\/view.php?id=3557<\/a><br \/>\nDie L\u00f6sung ist den Patch folgendermassen zu korrigieren:<\/p>\n<div class=\"php dean_ch\"><span class=\"co2\"># mit drei ===<br \/>\n<\/span><span class=\"co2\">#<br \/>\n<\/span><span class=\"kw1\">if<\/span> <span class=\"br0\">&#40;<\/span><span class=\"re0\">$listNum<\/span> <span class=\"sy0\">===<\/span> <span class=\"st_h\">&#8218;rand&#8216;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"re0\">$listNum<\/span> <span class=\"sy0\">=<\/span> <a href=\"http:\/\/www.php.net\/rand\"><span class=\"kw3\">rand<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"nu0\">0<\/span><span class=\"sy0\">,<\/span><a href=\"http:\/\/www.php.net\/count\"><span class=\"kw3\">count<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"re0\">$temp<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">&#8211;<\/span><span class=\"nu0\">1<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div>\n<hr \/>\n<p><strong>Problem:<\/strong> Legt man in Typo3 4.4.0 einen neuen Inhalt vom Typ &#8222;Text m.Bild \/ textpic&#8220; oder &#8222;Bilder\/image&#8220; an und f\u00fcgt mehrere Bilder und Links hinzu, dann wird der Link vom ersten Bild falsch gesetzt bzw. es wird einer aus allen verf\u00fcgbaren links zuf\u00e4llig ausgew\u00e4hlt.<\/p>\n<p>Das Problem scheint ein Bug von Typo3 4.4.0 zu sein. Die &#8222;register:IMAGE_NUM_CURRENT&#8220; scheint korrekt zu sein und die CSV werte f\u00fcr das listNum Objekt ebenso. Und f\u00fcr Captions oder Alt-Tags funktioniert das Splitting auch.<\/p>\n<p>Nur innerhalb des &#8222;typolink.parameter&#8220; scheint der Wert 0 von &#8222;register:IMAGE_NUM_CURRENT&#8220; &#8211; also der erste &#8211; irgendwie geleert\/gel\u00f6scht zu werden.<\/p>\n<p><strong>L\u00f6sung:<\/strong> Eine perfekte L\u00f6sung f\u00fcr den Bug nur per Typoscript habe ich nicht gefunden. Folgende Zeile im Typoscript Setup sollte aber die meisten probleme l\u00f6sen:<\/p>\n<div class=\"typoscript dean_ch\"><span class=\"co2\"># Den Link Parameter auf &quot;first&quot; setzen, wenn er Leer ist &#8211; was bei dem ersten Bild<\/span><br \/>\n<span class=\"co2\"># mit &quot;register:IMAGE_NUM_CURRENT&quot; = 0 der Fall ist<\/span><br \/>\n<span class=\"co2\"># <\/span><br \/>\n<span class=\"re3\">tt_content<\/span><span class=\"sy0\">.<\/span>image<span class=\"sy0\">.<\/span>20<span class=\"sy0\">.<\/span>1<span class=\"sy0\">.<\/span><a href=\"http:\/\/www.typo3.net\/tsref\/functions\/imagelinkwrap\/\"><span class=\"kw2\">imageLinkWrap<\/span><\/a><span class=\"sy0\">.<\/span><a href=\"http:\/\/www.typo3.net\/tsref\/functions\/typolink\/\"><span class=\"kw2\">typolink<\/span><\/a><span class=\"sy0\">.<\/span>parameter<span class=\"sy0\">.<\/span>listNum<span class=\"sy0\">.<\/span><a href=\"http:\/\/www.typo3.net\/tsref\/functions\/stdwrap\/\"><span class=\"kw2\">stdWrap<\/span><\/a><span class=\"sy0\">.<\/span>ifEmpty <span class=\"sy0\">=<\/span> first<\/div>\n<p>Probleme k\u00f6nnte es auch danach noch geben, wenn man zB. mehrere Bilder und mehrere links hat, aber weniger links als Bilder &#8211; also nicht jedes Bild einzeln verlinken will. Da bleibt wohl nur das Warten auf Typo3 4.4.1 &#8211; Ein Bug Report gibt es schon. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update: Das Problem ergibt sich nur, wenn f\u00fcr zuf\u00e4llige Hintergrundbilder der folgende Patch\/XCLASS verwendet wird:http:\/\/bugs.typo3.org\/view.php?id=3557 Die L\u00f6sung ist den Patch folgendermassen zu korrigieren: # mit drei === # if &#40;$listNum === &#8218;rand&#8216;&#41; $listNum = rand&#40;0,count&#40;$temp&#41;&#8211;1&#41;; Problem: Legt man in Typo3 4.4.0 einen neuen Inhalt vom Typ &#8222;Text m.Bild \/ textpic&#8220; oder &#8222;Bilder\/image&#8220; an und f\u00fcgt<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[77,78,180,181],"class_list":["post-173","post","type-post","status-publish","format-standard","hentry","category-typoscript","tag-bilder","tag-listnum","tag-typo3","tag-typoscript"],"_links":{"self":[{"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/posts\/173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/comments?post=173"}],"version-history":[{"count":13,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/posts\/173\/revisions"}],"predecessor-version":[{"id":188,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/posts\/173\/revisions\/188"}],"wp:attachment":[{"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/media?parent=173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/categories?post=173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/tags?post=173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}