---
title: "HTML einbindung funkt. nicht"
url: "https://www.typo3.net/d/111453-html-einbindung-funkt-nicht"
source: "typo3.net"
tags: ["Extensions","Entwicklung","Frage"]
created: "2012-07-23"
last_reply: "2012-07-24"
replies: 1
solved: false
page: 1
pages: 1
lang: "de"
---

# HTML einbindung funkt. nicht

Extensions › Entwicklung · 1 Antwort · gestartet 2012-07-23

## Eröffnungsbeitrag

**neridonk** · 2012-07-23 · [Beitrag #1](https://www.typo3.net/d/111453-html-einbindung-funkt-nicht/1)

Hi,
könnt ihr mir verraten warum meine HTML template einbidung nicht funktioniert?

```php
class tx_sortext_pi1 extends tslib_pibase {
    var $prefixId      = 'tx_sortext_pi1';        // Same as class name
    var $scriptRelPath = 'pi1/class.tx_sortext_pi1.php';    // Path to this script relative to the extension dir.
    var $extKey        = 'sortext';    // The extension key.
    var $pi_checkCHash = TRUE;
    var $template;

    /**
     * The main method of the Plugin.
     *
     * @param string $content The Plugin content
     * @param array $conf The Plugin configuration
     * @return string The content that is displayed on the website
     */
     
    
    
    public function main($content, array $conf) {
        $this->conf = $conf;
        $this->pi_setPiVarDefaults();
        $this->pi_loadLL();
         
    
        

        // $this->cObj->fileResource('sortext/template.html');

        $this->template=$this->cObj->fileResource('EXT:sortext/template.html');

  $sub['###LABEL1###'] = 'label eins';
  $sub['###LABEL2###'] = 'label zwoi';
  

  $tmpl = $this->cObj->substituteMarkerInObject($tmpl,$sub,'','');
  

  return $tmpl;    
        
        
        
        

  
        // $content = $this->Testmethode();
        
        return $this->pi_wrapInBaseClass($tmpl);
    }
}
    
    
 



if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/sortext/pi1/class.tx_sortext_pi1.php'])) {
    include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/sortext/pi1/class.tx_sortext_pi1.php']);
}

?>
```

template.html lieg in typo3conf\ext\sortext <- ordner

sollte doch eigentlich funktioieren:o

## Antworten

### [#2](https://www.typo3.net/d/111453-html-einbindung-funkt-nicht/2) · Drusilla · 2012-07-24

Du liest zwar das Template ein, aber du sagst nicht, welcher Subpart aus dem Template genommen werden soll. So in der Art:
$subpart=$this->cObj->getSubpart($this->template,'###LISTVIEW###');

Schau mal hier unter Teil 3:
<http://www.traum-projekt.com/forum/73-workshops-und-tutorials/101411-workshop-typo3-extension-programmierung.html>

---

Quelle: „HTML einbindung funkt. nicht“, typo3.net, https://www.typo3.net/d/111453-html-einbindung-funkt-nicht
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
