---
title: "wieso funktioniert der link nicht"
url: "https://www.typo3.net/d/64075-wieso-funktioniert-der-link-nicht"
source: "typo3.net"
tags: ["Extensions","Entwicklung","Frage","Links"]
created: "2007-06-18"
last_reply: "2007-06-18"
replies: 3
solved: false
page: 1
pages: 1
lang: "de"
---

# wieso funktioniert der link nicht

Extensions › Entwicklung · 3 Antworten · gestartet 2007-06-18

## Eröffnungsbeitrag

**nugget** · 2007-06-18 · [Beitrag #1](https://www.typo3.net/d/64075-wieso-funktioniert-der-link-nicht/1)

ich bin dabei ein fe_plugin zu schreiben. ich habe zu meiner extension ein html template eingebunden welches die marke ersetzt. funktioniert auch alles wunderbar bis auf die erstellung des links. dieser wird nicht als link markiert warum??

```php
	function listView($content,$conf)	{
		$this->conf=$conf;		// Setting the TypoScript passed to this function in $this->conf
		$this->pi_setPiVarDefaults();
		$this->pi_loadLL();		// Loading the LOCAL_LANG values
		
	#Preconfigure the typolink
	$this->local_cObj = t3lib_div::makeInstance('tslib_cObj');
	$this->local_cObj->setCurrentVal($GLOBALS['TSFE']->id);
	$this->typolink_conf = $this->conf['typolink.'];
	$this->typolink_conf['parameter.']['current'] = 1;
		
	# Get the template
	$this->templateCode = $this->cObj->fileResource($conf['templateFile']);
 
	# Get the parts out of the template
	$template['total'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE###');
	$template['list'] = $this->cObj->getSubpart($template['total'],'###LIST###');

    $query = "SELECT * FROM tx_bafiremissions_missions";
	$query .= " WHERE deleted = 0 AND hidden = 0 ";
    $res = mysql(TYPO3_db,$query);
	
	while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
		# Build content from template
		$markerArray['###MISSION_NR###'] = $row['mission_number'];             
		$markerArray['###MISSION_ART###'] = $row['mission_art'];
		$markerArray['###MISSION_DATE###'] = $row['mission_date'] = date("d.m.Y",$row['mission_date']);
		$markerArray['###MISSION_STREET###'] = $row['mission_street'];
		$markerArray['###MISSION_MSG###'] = $row['mission_msg'];
		$markerArray['###MISSION_DETAILS###'] = $row['mission_street'];
		
		$content_list .= $this->cObj->substituteMarkerArrayCached($template['list'], $markerArray);
		}   
	
	$subpartArray['###CONTENT###'] = $content_list; 
 
	# Typolink
	$temp_conf = $this->typolink_conf;
	$temp_conf['additionalParams'].= '&tx_bafiremissions_pi1[mode]=list&tx_bafiremissions_pi1[cat]='.$row['uid'];
	$temp_conf['useCacheHash']=$this->allowCaching;                            
	$temp_conf['no_cache']=!$this->allowCaching;
	$temp_conf['parameter.']['wrap'] = "|,".$GLOBALS['TSFE']->type;
	$wrappedSubpartContentArray['###LINK###'] = $this->local_cObj->typolinkWrap($temp_conf); 

	$content = $this->cObj->substituteMarkerArrayCached($template['total'], $markerArray, $subpartArray, $wrappedSubpartContentArray);
	return $content;  
    	}
```

```html
<!-- ###TEMPLATE### begin -->
 <table class="mission_list_table" cellpadding="2" cellspacing2="">
  <!-- ###CONTENT### -->
   <!-- ###LIST### -->
    <tr>
		<td class="mission_month" colspan="6">###MISSION_MONTH###</td>
	</tr>
	<tr>
     <td class="mission_nr">###MISSION_NR###</td>
	 <td class="mission_art">###MISSION_ART###</td>
	 <td class="mission_date">###MISSION_DATE###</td>
	 <td class="mission_street">###MISSION_STREET###</td>
	 <td class="mission_msg">###MISSION_MSG###</td>
	 <td class="mission_details"><!--###LINK###-->Mission Details<!--###LINK###--></td>
    </tr>
   <!-- ###LIST### -->
  <!-- ###CONTENT### -->
 </table>
<!-- ###TEMPLATE### end -->
```

## Antworten

### [#2](https://www.typo3.net/d/64075-wieso-funktioniert-der-link-nicht/2) · eisstern · 2007-06-18

Das geliche hatte ich auch for 2 Tagen. Die Funktion

```php
<?php
$this->local_cObj->typolinkWrap($temp_conf)
?>
```

gibt ein Array mit den Linktags zurück und nicht den Link selbst. Der erste Teil des Arrays ist der <a href...> und der zweite das </a>. Also musste du es so lösen:

```php
<?php
$temp = $this->local_cObj->typolinkWrap($temp_conf);
$wrappedSubpartContentArray['###LINK###'] = $temp[0]."Linktext".$temp[1];
?>
```

Hoffe das hilft.

### [#3](https://www.typo3.net/d/64075-wieso-funktioniert-der-link-nicht/3) · nugget · 2007-06-18

mhh irgendwie blick ich nicht so durch kannst mal meinen code nehmen und diesen korrigieren

### [#4](https://www.typo3.net/d/64075-wieso-funktioniert-der-link-nicht/4) · eisstern · 2007-06-18

Ich habe aus 1 Zeile 2 gemacht (Zeile 44). Mehr wars net. Du musst dir allerdings noch selber überlegen wie du den Linktext setzt.
Wie man zB den Seitentitel automatisch ausliest weiß ich selbst noch nicht. Muss da selber noch forschen. Bin für Infos offen ^^

Edit Begin
Hab grad erst gesehen dass ich da noch überall local_cObj geschrieben hab. Sollte der Code so nicht funktionieren mache überall mal nur cObj draus (also zb $this->**cObj**->typolinkWrap($temp_conf) )
Edit Ende

```php
<?php
function listView($content,$conf)       {
                $this->conf=$conf;            // Setting the TypoScript passed to this function in $this->conf
                $this->pi_setPiVarDefaults();
                $this->pi_loadLL();          // Loading the LOCAL_LANG values
               
        #Preconfigure the typolink
        $this->local_cObj = t3lib_div::makeInstance('tslib_cObj');
        $this->local_cObj->setCurrentVal($GLOBALS['TSFE']->id);
        $this->typolink_conf = $this->conf['typolink.'];
        $this->typolink_conf['parameter.']['current'] = 1;
               
        # Get the template
        $this->templateCode = $this->cObj->fileResource($conf['templateFile']);
 
        # Get the parts out of the template
        $template['total'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE###');
        $template['list'] = $this->cObj->getSubpart($template['total'],'###LIST###');

    $query = "SELECT * FROM tx_bafiremissions_missions";
        $query .= " WHERE deleted = 0 AND hidden = 0 ";
    $res = mysql(TYPO3_db,$query);
       
        while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                # Build content from template
                $markerArray['###MISSION_NR###'] = $row['mission_number'];             
                $markerArray['###MISSION_ART###'] = $row['mission_art'];
                $markerArray['###MISSION_DATE###'] = $row['mission_date'] = date("d.m.Y",$row['mission_date']);
                $markerArray['###MISSION_STREET###'] = $row['mission_street'];
                $markerArray['###MISSION_MSG###'] = $row['mission_msg'];
                $markerArray['###MISSION_DETAILS###'] = $row['mission_street'];
               
                $content_list .= $this->cObj->substituteMarkerArrayCached($template['list'], $markerArray);
                }   
       
        $subpartArray['###CONTENT###'] = $content_list;
 
        # Typolink
        $temp_conf = $this->typolink_conf;
        $temp_conf['additionalParams'].= '&tx_bafiremissions_pi1[mode]=list&tx_bafiremissions_pi1[cat]='.$row['uid'];
        $temp_conf['useCacheHash']=$this->allowCaching;                           
        $temp_conf['no_cache']=!$this->allowCaching;
        $temp_conf['parameter.']['wrap'] = "|,".$GLOBALS['TSFE']->type;
        $temp = $this->local_cObj->typolinkWrap($temp_conf);
        $wrappedSubpartContentArray['###LINK###'] = $temp[0]."Linktext".$temp[1];
        //$wrappedSubpartContentArray['###LINK###'] = $this->local_cObj->typolinkWrap($temp_conf);

        $content = $this->cObj->substituteMarkerArrayCached($template['total'], $markerArray, $subpartArray, $wrappedSubpartContentArray);
        return $content; 
        }
?>
```

---

Quelle: „wieso funktioniert der link nicht“, typo3.net, https://www.typo3.net/d/64075-wieso-funktioniert-der-link-nicht
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
