---
title: "content rendern ohne body tag"
url: "https://www.typo3.net/d/74482-content-rendern-ohne-body-tag"
source: "typo3.net"
tags: ["Extensions","Entwicklung","Frage","JavaScript & AJAX"]
created: "2008-03-05"
last_reply: "2008-03-08"
replies: 2
solved: false
page: 1
pages: 1
lang: "de"
---

# content rendern ohne body tag

Extensions › Entwicklung · 2 Antworten · gestartet 2008-03-05

## Eröffnungsbeitrag

**masterjcl** · 2008-03-05 · [Beitrag #1](https://www.typo3.net/d/74482-content-rendern-ohne-body-tag/1)

Gibt es eine Möglichkeit Content ohne den Body und Head auszugeben ??

Ich benötige das für ein paar ajax funktionen sonst muss ich jedesmal manuell den Content aus dem Response extrahieren.

Ideal währe es wenn es typoscript im Seitenbaum abbeschaltet werden kann.

mfg

## Antworten

### [#2](https://www.typo3.net/d/74482-content-rendern-ohne-body-tag/2) · ThBodi · 2008-03-05

Schau' Dir doch mal folgendes an: <http://www.typo3-tutorials.org/tutorials/extensions/eid-mechanismus.html>, vielleicht passt das auch zu Deinen Planungen.

### [#3](https://www.typo3.net/d/74482-content-rendern-ohne-body-tag/3) · masterjcl · 2008-03-08

Für alle die auch ein derartiges Problem haben ich habe ein Skeleton geschrieben damit sollten sich alle Probleme lösen lassen. Feedback erwünscht. Mir wird hier auch immer so schnell geholfen ;-)

```php
<?php
/*
 Ajax XML Skeleton Service for Typo3 v4.2 
 by Hit-Enter X-Solution
 Jens-Carsten Lukas
 jc.lukas@hit-enter.de
 Important:
 insert into ext_localconf.php follow line change ext path to script
 $TYPO3_CONF_VARS['FE']['eID_include']['hex'] = 'EXT:hextouristic/hexservice.php';
 Action URL for getData
 index.php?eID=hex&hexi=0 
*/
// send encoding and send no-cache
header('Content-Type: text/xml; charset=UTF-8');
header("Pragma: no-cache");
header("Expires: 0");
//  some security check and includes
if (!defined ('TYPO3_MODE')) 	die ('Access denied.');
require_once(PATH_tslib . 'class.tslib_pibase.php');
//require_once(PATH_tslib . 'class.tslib_content.php');
//require_once(PATH_t3lib . 'class.t3lib_stdgraphic.php');
//require_once(PATH_tslib . 'class.tslib_gifbuilder.php');
require_once(PATH_tslib . 'class.tslib_eidtools.php');
//require_once(PATH_t3lib . 'class.t3lib_page.php');

class hexservice extends tslib_pibase {
var $feUserObj = null;
var $pageid=0;
var $action=0;
var $output='';
// Query-Data  related
var $table='fe_users left join tt_address on fe_users.fkgoogle=tt_address.uid ';
var $get_fields='*';
var $where='fe_users.fkgoogle > 0';
var $fields =  array(
                     'uid',
                     'tx_rggooglemap_lng',
                     'tx_rggooglemap_lat',
                     'tx_rggooglemap_tab',
                     'street',
                     'zip',
                     'city',
                     'first_name',
                     'last_name',
                     'name',
                     'telephone',                                                                                    
                     'www',
                     'email',
                     'image'                                          
                    );
// end of Data related Section
function main(){
               // some pre init's
               $this->feUserObj = tslib_eidtools::initFeUser();
               tslib_eidtools::connectDB();
               // get the Action Codes and some Stuff
               $this->action=intval(t3lib_div::_GET('hexi'));
               $this->pageid=intval(t3lib_div::_GET('pageId'));
               $piVars['pageId'] = intval(t3lib_div::_GET('pageId'));               
               // some Actions
               switch($this->action){
               case 0: 
                     $this->getData();
                     print $this->output;
                     break;
               case 1: 
                     $this->test();
                     print $this->output;
                     break;
               default:
                     print '<warn>Warning: there is no Action for hexservice Service !</warn>';
               }
}

protected function test(){
$this->output='<test>Test Function !</test>';
}

protected function tagMake($data,$ref){
foreach($ref as $fieldname):
  $this->output .= '<'.$fieldname.'>' . $data[$fieldname]  . '</'.$fieldname.'>';
endforeach;
}

protected function getData(){
           		$query = $GLOBALS['TYPO3_DB']->SELECTquery($this->get_fields, $this->table, $this->where, null, null, null);
 		          $result = $GLOBALS['TYPO3_DB']->sql_query($query);
		          if($result) {
		                      $this->output .= '<?xml version="1.0" encoding="utf-8" standalone="yes" ?><data>';
  			                  while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) 
                                  {
                                  $this->output .= '<item>';
                                  $this->tagMake($row,$this->fields);
                                  $this->output .= '</item>';
                                  }
                          $this->output .= '</data>';
                          }
}

}
// create Instance and Start the Service
$output = t3lib_div::makeInstance('hexservice');
$output->main();

if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/hextouristic/hexservice.php'])	{
	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/hextouristic/hexservice.php']);
}

?>
```

---

Quelle: „content rendern ohne body tag“, typo3.net, https://www.typo3.net/d/74482-content-rendern-ohne-body-tag
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
