{"id":372,"date":"2011-08-08T16:14:17","date_gmt":"2011-08-08T16:14:17","guid":{"rendered":"https:\/\/www.taywa.ch\/blog\/?p=372"},"modified":"2013-05-17T08:22:31","modified_gmt":"2013-05-17T08:22:31","slug":"typo3-tt_news-genericmarkers-kategorietitel-share-url","status":"publish","type":"post","link":"https:\/\/www.taywa.ch\/blog\/typo3\/typoscript\/typo3-tt_news-genericmarkers-kategorietitel-share-url\/","title":{"rendered":"Typo3 tt_news mit genericmarkers erg\u00e4nzen &mdash; zb f\u00fcr: Kategorietitel, Share-URL, etc&#8230;"},"content":{"rendered":"<p><strong>tt_news ist eine flexible extension f\u00fcr typo3, mit der sich weit mehr abbilden lassen als nur news. und mit dem genericmarkers feature kann man tt_news fast beliebig erweitern. hier zwei beispiele:<\/strong><\/p>\n<h2>Share URL in Listview<\/h2>\n<p><strong>Problem:<\/strong> man braucht f\u00fcr addthis (facebook, twitter, digg usw.) die url &#8211; und nur die url; nicht den ganzen link &#8211; zur einzelansicht schon in der listenansicht.<\/p>\n<p><strong>L\u00f6sung: <\/strong> im tt_news template bei ###TEMPLATE_LATEST### oder  ###TEMPLATE_LIST### den neuen marker ###GENERIC_URL### hinzuf\u00fcgen. f\u00fcr addthis s\u00e4he das so aus:<\/p>\n<div class=\"html dean_ch\">&lt;div class=&quot;addthis_toolbox custom_images&quot;<br \/>\n&nbsp; &nbsp; addthis:url=&quot;###GENERIC_URL###&quot;<br \/>\n&nbsp; &nbsp; addthis:title=&quot;###NEWS_TITLE### &#8211; ###NEWS_CATEGORY###&quot;&gt;<br \/>\n&nbsp; &nbsp; &lt;a class=&quot;addthis_button_compact&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;img src=&quot;share.jpg&quot; alt=&quot;Share&#8230;&quot; \/&gt;<br \/>\n&nbsp; &nbsp; &lt;\/a&gt;<br \/>\n&lt;\/div&gt;<\/div>\n<p>nun muss im typoscript setup der generic marker hinzugef\u00fcgt werden. f\u00fcr die URL geht das so:<\/p>\n<div class=\"typoscript dean_ch\"><a href=\"http:\/\/www.typo3.net\/tsref\/setup\/plugin\/\"><span class=\"kw3\">plugin<\/span><\/a><span class=\"sy0\">.<\/span>tt_news<span class=\"sy0\">.<\/span>genericmarkers<span class=\"sy0\">.<\/span>URL <span class=\"sy0\">=<\/span> <a href=\"http:\/\/www.typo3.net\/tsref\/cobject\/coa\/\"><span class=\"kw4\">COA<\/span><\/a><br \/>\n<a href=\"http:\/\/www.typo3.net\/tsref\/setup\/plugin\/\"><span class=\"kw3\">plugin<\/span><\/a><span class=\"sy0\">.<\/span>tt_news<span class=\"sy0\">.<\/span>genericmarkers<span class=\"sy0\">.<\/span>URL <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"nu0\">1<\/span> <span class=\"sy0\">=<\/span> <a href=\"http:\/\/www.typo3.net\/tsref\/cobject\/text\/\"><span class=\"kw4\">TEXT<\/span><\/a><br \/>\n&nbsp; &nbsp; <span class=\"nu0\">1<\/span><span class=\"sy0\">.<\/span>data <span class=\"sy0\">=<\/span> TSFE<span class=\"sy0\">:<\/span>baseUrl<\/p>\n<p>&nbsp; &nbsp; <span class=\"nu0\">2<\/span> <span class=\"sy0\">=<\/span> <a href=\"http:\/\/www.typo3.net\/tsref\/cobject\/text\/\"><span class=\"kw4\">TEXT<\/span><\/a><br \/>\n&nbsp; &nbsp; <span class=\"nu0\">2<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; value <span class=\"sy0\">=<\/span> <br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <a href=\"http:\/\/www.typo3.net\/tsref\/functions\/typolink\/\"><span class=\"kw2\">typolink<\/span><\/a> <span class=\"sy0\">=<\/span> <span class=\"nu0\">1<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <a href=\"http:\/\/www.typo3.net\/tsref\/functions\/typolink\/\"><span class=\"kw2\">typolink<\/span><\/a> <span class=\"br0\">&#123;<\/span><br \/>\n<span class=\"co2\"># seiten id auf dem sich das singleview plugin befindet:<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; parameter <span class=\"sy0\">=<\/span> <span class=\"nu0\">15<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; additionalParams <span class=\"sy0\">=<\/span> &amp;<span class=\"re3\">tx_ttnews<\/span><span class=\"br0\">&#91;<\/span><span class=\"re3\">tt_news<\/span><span class=\"br0\">&#93;<\/span><span class=\"sy0\">=<\/span><span class=\"br0\">&#123;<\/span>field<span class=\"sy0\">:<\/span>uid<span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; additionalParams<span class=\"sy0\">.<\/span>insertData <span class=\"sy0\">=<\/span> <span class=\"nu0\">1<\/span><br \/>\n<span class=\"co2\"># folgene zeile bewirkt, dass nur die URL und<\/span><br \/>\n<span class=\"co2\"># nicht der ganze link \/ a tag ausgegeben wird:<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; returnLast <span class=\"sy0\">=<\/span> url<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><\/div>\n<h2>Kategorietitel in der Listview<\/h2>\n<p><strong>Problem:<\/strong> wir haben eine listenansicht, in der wir alle news einer kategorie auflisten. die gew\u00fcnschte kategorie wird per get in der url \u00fcbergeben. nun m\u00f6chten wir zus\u00e4tzlich titel (und\/oder description und catimage) anzeigen.<\/p>\n<p><strong>L\u00f6sung:<\/strong> Leider habe ich nichts einfacheres\/eleganteres gefunden als wieder die genericmarkers zu bem\u00fchen. hier das snippet:<\/p>\n<div class=\"typoscript dean_ch\"><span class=\"co2\"># im template den marker <\/span><span class=\"re6\">###GENERIC_CATTITLE###<\/span><br \/>\n<span class=\"co2\"># an gew\u00fcnschter stelle einf\u00fcgen.<\/span><br \/>\n#<br \/>\n<span class=\"co2\"># folgendes snippet ins typoscript setup:<\/span><br \/>\n<a href=\"http:\/\/www.typo3.net\/tsref\/setup\/plugin\/\"><span class=\"kw3\">plugin<\/span><\/a><span class=\"sy0\">.<\/span>tt_news<span class=\"sy0\">.<\/span>genericmarkers<span class=\"sy0\">.<\/span>CATTITLE <span class=\"sy0\">=<\/span> <a href=\"http:\/\/www.typo3.net\/tsref\/cobject\/content\/\"><span class=\"kw4\">CONTENT<\/span><\/a><br \/>\n<a href=\"http:\/\/www.typo3.net\/tsref\/setup\/plugin\/\"><span class=\"kw3\">plugin<\/span><\/a><span class=\"sy0\">.<\/span>tt_news<span class=\"sy0\">.<\/span>genericmarkers<span class=\"sy0\">.<\/span>CATTITLE <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; table <span class=\"sy0\">=<\/span> <span class=\"re3\">tt_news_cat<\/span><br \/>\n&nbsp; &nbsp; <a href=\"http:\/\/www.typo3.net\/tsref\/functions\/select\/\"><span class=\"kw2\">select<\/span><\/a> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; pidInList <span class=\"sy0\">=<\/span> <span class=\"nu0\">6<\/span> &nbsp; <span class=\"co1\">\/\/ pid des news sysfolders<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; andWhere <span class=\"sy0\">=<\/span> uid<span class=\"sy0\">=<\/span><span class=\"br0\">&#123;<\/span>GPvar<span class=\"sy0\">:<\/span><span class=\"re3\">tx_ttnews<\/span><span class=\"sy0\">|<\/span>cat<span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; andWhere<span class=\"sy0\">.<\/span>insertData <span class=\"sy0\">=<\/span> <span class=\"nu0\">1<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; selectFields <span class=\"sy0\">=<\/span> title<br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; renderObj <span class=\"sy0\">=<\/span> <a href=\"http:\/\/www.typo3.net\/tsref\/cobject\/coa\/\"><span class=\"kw4\">COA<\/span><\/a><br \/>\n&nbsp; &nbsp; renderObj <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"nu0\">10<\/span> <span class=\"sy0\">=<\/span> <a href=\"http:\/\/www.typo3.net\/tsref\/cobject\/text\/\"><span class=\"kw4\">TEXT<\/span><\/a><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"nu0\">10<\/span><span class=\"sy0\">.<\/span>field <span class=\"sy0\">=<\/span> title<br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><\/div>\n","protected":false},"excerpt":{"rendered":"<p>tt_news ist eine flexible extension f\u00fcr typo3, mit der sich weit mehr abbilden lassen als nur news. und mit dem genericmarkers feature kann man tt_news fast beliebig erweitern. hier zwei beispiele: Share URL in Listview Problem: man braucht f\u00fcr addthis (facebook, twitter, digg usw.) die url &#8211; und nur die url; nicht den ganzen link<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,4],"tags":[90,63,180,181],"class_list":["post-372","post","type-post","status-publish","format-standard","hentry","category-extension-konfiguration","category-typoscript","tag-extension","tag-tt_news","tag-typo3","tag-typoscript"],"_links":{"self":[{"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/posts\/372","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=372"}],"version-history":[{"count":24,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/posts\/372\/revisions"}],"predecessor-version":[{"id":553,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/posts\/372\/revisions\/553"}],"wp:attachment":[{"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/media?parent=372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/categories?post=372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/tags?post=372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}