da hab ich den profi an der angel :-)
zeile 49 ist folgende
# Get the template
$this->templateCode = $this->cObj->fileResource($conf['templateFile']);
da hab ich den profi an der angel :-)
zeile 49 ist folgende
# Get the template
$this->templateCode = $this->cObj->fileResource($conf['templateFile']);
Hast du denn in deinem Setup den Pfad zum Template angegeben, also so
plugin.tx_deineext_pi1.templateFile = fileadmin/deintemplate.html
?
zum testen überschreib in zeile 49 doch das
$conf['templateFile']
mit dem Pfad zum Template
georg
Also template liegt in fileadmin/template.html
in die datei ext: static/Setup/setup.txt habe ich folgendes reingeschrieben:
plugin.tx_firemissions_pi1.templateFile = fileadmin/template.html
und zeile 49 sieht jetzt so aus:
# Get the template
#$this->templateCode = $this->cObj->fileResource($conf['templateFile']);
$conf['templateFile']
es kommt wieder
Parse error: parse error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /var/web/www.feuerwehr-zimmern.de/htdocs/typo3conf/ext/byteaction_firemissions/pi1/class.tx_byteactionfiremissions_pi1.php on line 50
nur halt in zeile 50 da ich zeile 49 auskommentiert habe
stell mal das ganze online, zB auf phpfi.com mit zeilenangabe des aktuellen fehlers
georg
du kannst nicht einfach so irgendnen code in php platzieren. das geht in TS, aber nicht in php!
so sollte es eigentlich schon funktionieren
<?
$this->templateCode = $this->cObj->fileResource('fileadmin/template.html');
# $conf['templateFile']
# Get the parts out of the template
$template['total'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE###');
# create the content by replacing the marker in the template
$markerArray['###MARKER1###'] = 'content for marker 1';
$markerArray['###MARKER2###'] = 'content for marker 2';
$content = $this->cObj->substituteMarkerArrayCached($template['total'],$markerArray);
return $content;
?>
georg
danke für deine antwort aber leider funktioniert es immer noch nicht bekomme folgende fehler meldung:
Parse error: parse error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /var/web/www.feuerwehr-zimmern.de/htdocs/typo3conf/ext/byteaction_firemissions/pi1/class.tx_byteactionfiremissions_pi1.php on line 49
hier der code:
http://phpfi.com/238081
häng mal an die url ein no_cache=1 an, bin mir nicht sicher ob die 2 zusammenpassen...
georg
funktioniert auch nicht!!!
wie gesagt das das erste mal das ich extension selbst erstelle ich hab immer nur gehört das soll so einfach sein. warum funzt das dann bei mir nicht #angry#
Also ich habe es jetzt mit folgendem code geschafft das er mir "Kein Template gefunden" ausgibt:
function main($content,$conf)
{
$this->conf=$conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
// No cache
#$GLOBALS["TSFE"]->set_no_cache();
$this->templateFile = $this->conf['templateFile'];
if (!$templateFile)
{
return'<h1>Kein Template gefunden</h1>';
#$templateFile = 'res/template.html';
}
$this->templateCode = $this->cObj->fileResource($conf['templateFile']);
#Get the parts out of the template
$template['total'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE###');
# create the content by replacing the marker in the template
$markerArray['###MARKER1###'] = 'content for marker 1';
$markerArray['###MARKER2###'] = 'content for marker 2';
$content = $this->cObj->substituteMarkerArrayCached($template['total'],$markerArray);
return $content;
}
obwohl er doch eigentlich folgendes html template ausgeben müsste was in res/template.html zu finden ist:
<h3>TEMPLATE</h3>
<em>This is a simple HTML-Template</em>
<!-- ###TEMPLATE### begin -->
<h1>###MARKER1###</h1><h1>###MARKER2###</h1>
<!-- ###TEMPLATE### end -->
weil ich das template ja mit
plugin.tx_byteaction_firemissions_pi1 {
templateFile = res/template.html
}
aus der datei static/Setup/setup.txt anspreche
oder irre ich mich da??
templateFile = res/template.html
das geht schon von root aus, und da gibt es in aller regel kein res/ .. also eher ein
templateFile = EXT:deinextkey/res/template.html
georg
yippi habe es hinbekommen das mein template eingelesen wird!
ich habe das template (template.html) in das verzeichnis pi1/ kopiert und den pfad in der Datei ext_typoscript_setup.txt angepasst:
plugin.tx_byteactionfiremissions_pi1.templateFile = EXT:byteaction_firemissions/pi1/template.html
hallo nugget,
habe gerade das selbe problem.
auch bei mir schreibt er "Kein Template gefunden".
danach verschob ich mein template nach pi1 und habe die pfade angepasst. leider ändert sich bei mir überhaupt nichts.
hast du einen tip für mich?
danke
na wie schon gesagt bei mir hat es funktioniert indem ich mein template in den ordner "pi1" verschoben habe und dann in der datei ext_typoscript_setup.txt (die sich im Hauptverzeichnis der Extension befindet folgendes TS eingetragen habe
plugin.tx_DEINEXTENSIONNAME_pi1.templateFile = EXT:DEINEXTENSIONNAME/pi1/template.html
Ich hoffe ich konnte dir damit helfen leider bin ich auch net gerade ein Schlaufuchs auf diesem Gebiet!
Good Luck