Antwort
 
LinkBack Themen-Optionen Thema bewerten Ansicht
  #11  
Alt 31.08.06, 09:35
Forum Newbie
 
Registriert seit: 05.04.06
Alter: 27
Beiträge: 43

falls du noch keine ausgabe haben solltest:

Code:
$this->cObj->fileResource('/fileadmin/template/hotel-manager.html');
der übergebene string stellt natürlich keinen relativen sondern einen absoluten Pfad dar

mittels
Code:
$this->cObj->fileResource('fileadmin/template/hotel-manager.html');
sollte es besser gehen

im übrigen reicht es nach dem du das Array $sub gefüllt hast die funktion
"substituteMarkerInObject" einmal aufzurufen, sie ersetzt dann alle im array $sub enthalten keys durch den korrespondierenden value, also im template dann.
hoffe das war verständlich.

gruss

Geändert von eucstyle (31.08.06 um 09:38 Uhr).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #12  
Alt 22.01.07, 11:27
Forum Newbie
 
Registriert seit: 22.02.06
Alter: 30
Beiträge: 29

Hallo,
ich habe den code vom eucstyle (30.8.2006) übernommen und ausprobiert allerdings bekomme ich keine ausgabe im frontend. Wahrscheinlich kann auf das template nicht zugegrifen werden. Dabei habe ich beide Möglichkeiten ausprobiert:
$this->cObj->fileResource('fileadmin/template.html');
$this->cObj->fileResource('/fileadmin/template.html');
Weiß jemand woran das liegen kann?
danke
Ilinca
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #13  
Alt 07.11.07, 16:00
Forum Zuschauer
 
Registriert seit: 07.11.07
Alter: 19
Beiträge: 1
Cool

Ich habe soweit auch mal alles übernommen und bekomme auch keine ausgabe... und soweit ich weiß muss ich ja im typoscript template ja auch nichts einfügen da das frontent plug in das doch übernimmt oder?

also hier mal meine ganzen angaben die ich gemacht hab...

PHP-Code:
<?php
/***************************************************************
*  Copyright notice
*
*  (c) 2007 Manuel Ruck <Panda@jungsfinest.de>
*  All rights reserved
*
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

require_once(PATH_tslib.'class.tslib_pibase.php');


/**
 * Plugin 'Artist site' for the 'reb_artist' extension.
 *
 * @author    Manuel <Panda@jungsfinest.de>
 * @package    TYPO3
 * @subpackage    tx_rebartist
 */
class tx_rebartist_pi1 extends tslib_pibase {
 function 
main($content,$conf){
  
$this->conf=$conf;
  
$this->pi_setPiVarDefaults();
  
$this->pi_loadLL();
  
  
// Template in string-variable einlesen
  
$this->cObj->fileResource('fileadmin/template/artistpage.tmpl');

  
// array erstellen das die zu ersetzenden labels enthält
  
$sub['###NAME###'] = '$name';
  
  
// Mittels typo-funktion labels aus array ersetzen lassen:
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'','');
  
  
// von deinem plugin erzeugten content an typo zurückliefern:
  
return $tmpl;
 }
}

if (
defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reb_artist/pi1/class.tx_rebartist_pi1.php'])    {
    include_once(
$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reb_artist/pi1/class.tx_rebartist_pi1.php']);
}

?>
erstmal nur eine angabe um das zu testen obs überhaupt geht...

DAS TEMPLATE
HTML-Code:
ghkhjkgjgjk
<!--###ARTIST_PAGE###--> <!--###ARTIST_INFO###--> <h3>###NAME###</h3><br />
        ###PICTURE###
       <!--###ARTIST_INFO###--> <!--###ARTIST_PAGE###-->
das ding oben hab ich mal mit eingefügt, um zu testen ob überhaupt etwas ausgegeben wird... aber tuts net...

UND hier mal die Dumb DB da man da nen paar felder sieht die ich erstellt hatb...
Typoscript-Code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
[b]Table and field structure required[/b]

Dumping current database structure for: - ERROR: Line 2: Object Name String, "Dumping" was not preceeded by any operator, =<>({

[b]Tables:[/b]
tx_rebartist_artistinfo - ERROR: Line 5: Object Name String, "tx_rebartist_artistinfo" was not preceeded by any operator, =<>({
tx_rebartist_genre - ERROR: Line 6: Object Name String, "tx_rebartist_genre" was not preceeded by any operator, =<>({
tx_rebartist_name - ERROR: Line 7: Object Name String, "tx_rebartist_name" was not preceeded by any operator, =<>({
[b][url="http://www.typo3.jungsfinest.de/typo3/mod/tools/em/index.php?CMD%5BshowExt%5D=reb_artist&CMD%5BwriteTFdump%5D=1"]Write this dump to ext_tables.sql now![/b] # TYPO3 Extension Manager dump 1.1
#
# Host: localhost    Database: TYPO3
#--------------------------------------------------------


#
# Table structure for table "tx_rebartist_artistinfo"
#
CREATE TABLE tx_rebartist_artistinfo ( - ERROR: Line 17: Object Name String, "CREATE" was not preceeded by any operator, =<>({
uid int(11) auto_increment, - ERROR: Line 18: Object Name String, "uid" was not preceeded by any operator, =<>({
pid int(11) default '0', - ERROR: Line 19: Object Name String, "pid" was not preceeded by any operator, =<>({
tstamp int(11) default '0', - ERROR: Line 20: Object Name String, "tstamp" was not preceeded by any operator, =<>({
crdate int(11) default '0', - ERROR: Line 21: Object Name String, "crdate" was not preceeded by any operator, =<>({
cruser_id int(11) default '0', - ERROR: Line 22: Object Name String, "cruser_id" was not preceeded by any operator, =<>({
deleted tinyint(4) default '0', - ERROR: Line 23: Object Name String, "deleted" was not preceeded by any operator, =<>({
hidden tinyint(4) default '0', - ERROR: Line 24: Object Name String, "hidden" was not preceeded by any operator, =<>({
name int(11) default '0', - ERROR: Line 25: Object Name String, "name" was not preceeded by any operator, =<>({
picture blob, - ERROR: Line 26: Object Name String, "picture" was not preceeded by any operator, =<>({
genre blob, - ERROR: Line 27: Object Name String, "genre" was not preceeded by any operator, =<>({
website tinytext, - ERROR: Line 28: Object Name String, "website" was not preceeded by any operator, =<>({
myspace tinytext, - ERROR: Line 29: Object Name String, "myspace" was not preceeded by any operator, =<>({
biography text, - ERROR: Line 30: Object Name String, "biography" was not preceeded by any operator, =<>({
discography text, - ERROR: Line 31: Object Name String, "discography" was not preceeded by any operator, =<>({
PRIMARY KEY (uid), - ERROR: Line 32: Object Name String, "PRIMARY" was not preceeded by any operator, =<>({
KEY parent (pid) - ERROR: Line 33: Object Name String, "KEY" was not preceeded by any operator, =<>({
); - ERROR: Line 34: Object Name String, ");" contains invalid character ")". Must be alphanumeric or one of: "_-."


#
# Table structure for table "tx_rebartist_genre"
#
CREATE TABLE tx_rebartist_genre ( - ERROR: Line 40: Object Name String, "CREATE" was not preceeded by any operator, =<>({
uid int(11) auto_increment, - ERROR: Line 41: Object Name String, "uid" was not preceeded by any operator, =<>({
pid int(11) default '0', - ERROR: Line 42: Object Name String, "pid" was not preceeded by any operator, =<>({
tstamp int(11) default '0', - ERROR: Line 43: Object Name String, "tstamp" was not preceeded by any operator, =<>({
crdate int(11) default '0', - ERROR: Line 44: Object Name String, "crdate" was not preceeded by any operator, =<>({
cruser_id int(11) default '0', - ERROR: Line 45: Object Name String, "cruser_id" was not preceeded by any operator, =<>({
genre tinytext, - ERROR: Line 46: Object Name String, "genre" was not preceeded by any operator, =<>({
PRIMARY KEY (uid), - ERROR: Line 47: Object Name String, "PRIMARY" was not preceeded by any operator, =<>({
KEY parent (pid) - ERROR: Line 48: Object Name String, "KEY" was not preceeded by any operator, =<>({
); - ERROR: Line 49: Object Name String, ");" contains invalid character ")". Must be alphanumeric or one of: "_-."


#
# Table structure for table "tx_rebartist_name"
#
CREATE TABLE tx_rebartist_name ( - ERROR: Line 55: Object Name String, "CREATE" was not preceeded by any operator, =<>({
uid int(11) auto_increment, - ERROR: Line 56: Object Name String, "uid" was not preceeded by any operator, =<>({
pid int(11) default '0', - ERROR: Line 57: Object Name String, "pid" was not preceeded by any operator, =<>({
tstamp int(11) default '0', - ERROR: Line 58: Object Name String, "tstamp" was not preceeded by any operator, =<>({
crdate int(11) default '0', - ERROR: Line 59: Object Name String, "crdate" was not preceeded by any operator, =<>({
cruser_id int(11) default '0', - ERROR: Line 60: Object Name String, "cruser_id" was not preceeded by any operator, =<>({
name tinytext, - ERROR: Line 61: Object Name String, "name" was not preceeded by any operator, =<>({
PRIMARY KEY (uid), - ERROR: Line 62: Object Name String, "PRIMARY" was not preceeded by any operator, =<>({
KEY parent (pid) - ERROR: Line 63: Object Name String, "KEY" was not preceeded by any operator, =<>({
); - ERROR: Line 64: Object Name String, ");" contains invalid character ")". Must be alphanumeric or one of: "_-."

hoffe mir kann jemand helfen
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #14  
Alt 19.08.08, 14:50
Forum Zuschauer
 
Registriert seit: 04.05.08
Beiträge: 10

Ich hole diesen doch recht alten Thread mal wieder hoch, weil ich genau dasselbe Problem habe und kein extra topic eröffnen wollte...

Zitat:
Zitat von eucstyle Beitrag anzeigen
template in variable holen:
labels ersetzen:
Code:
$sub['###LABEL1###'] = 'was auch immer für ein text';
$sub['###LABEL2###'] = 'was auch immer für ein text 2';
$tmpl = $this->cObj->substituteMarkerInObject($tmpl, $sub,'','');
anschliesend im der main-funktion
Code:
return $tmpl;
erzeugten content zurückgeben.
und schon wird dein Template mit ersetzen labels, die du natürlich selbst definieren musst, an typo zur ausgabe übergeben.
Im ersten Teil definiere ich sozusagen einen Marker und im zweiten Schritt definiere ich von was dieser Marker dann ersetzt wird?

Richtig schlau werde ich daraus allerdings nicht... angenommen ich habe in meiner Extension (um mal beim ersten Beispiel zu bleiben) "doppelzimmerpreis" wie würde der zweite Schritt dann konkret aussehen?

Code:
$tmpl = $this->cObj->substituteMarkerInObject($tmpl,$sub,'###DOPPELZIMMERPREIS###','$doppelzimmerpreis');
wäre also zuviel des guten?

Code:
$sub['###LABEL2###'] = '$doppelzimmerpreis';
$tmpl = $this->cObj->substituteMarkerInObject($tmpl, $sub,'','')
Würde also schon reichen?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #15  
Alt 19.08.08, 15:20
Benutzerbild von mstuebner
TYPO3 Forum Team
Moderator
 
Registriert seit: 01.09.04
Ort: 84424 Isen b. Dorfen
Alter: 41
Beiträge: 2.215
mstuebner eine Nachricht über Skype™ schicken

Für Deine Anwendung sollte substituteMarkerArray() wesentlich überschaubarer und einfacher anwendbar sein.
__________________
mfg Matthias

TYPO3-Consultant -- TYPO3 Entwicklung
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #16  
Alt 19.08.08, 17:29
Forum Zuschauer
 
Registriert seit: 04.05.08
Beiträge: 10

Erstmal vielen Dank für die Antwort, so ganz blicke ich aber noch nicht durch wie sähe das dann genau aus wenn ich den Marker DOPPELZIMMER durch das Feld doppelzimmerpreis ersetzen lassen will?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #17  
Alt 19.08.08, 17:33
Benutzerbild von mstuebner
TYPO3 Forum Team
Moderator
 
Registriert seit: 01.09.04
Ort: 84424 Isen b. Dorfen
Alter: 41
Beiträge: 2.215
mstuebner eine Nachricht über Skype™ schicken

PHP-Code:
$sub['###PREIS###'] = $doppelzimmerpreis;
$tmpl $this->cObj->substituteMarkerArray($tmpl$sub); 
__________________
mfg Matthias

TYPO3-Consultant -- TYPO3 Entwicklung
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #18  
Alt 19.08.08, 17:41
Forum Zuschauer
 
Registriert seit: 04.05.08
Beiträge: 10

Prompte Bedienung Vielen Dank, dann mach ich mich mal ans Werk!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #19  
Alt 19.08.08, 17:58
Forum Zuschauer
 
Registriert seit: 04.05.08
Beiträge: 10

Ein Problem ergibt sich dann doch leider noch. Ich habe mit dem DB APP Builder mehrere Ansichten erstellt, reicht es einfach wenn ich dann dort in den Einstellungen ein Templatefile angebe oder müsste ich die Marker dann auch für jede Ansicht extra definieren?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht Thema bewerten
Thema bewerten:

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Gelöst HTML Template erstellen und einbinden? MisterEko01 Direct Mail 1 16.05.08 21:35
Html Template einbinden DonTypo TYPO3 4.x Fragen und Probleme 1 05.02.08 18:55
HTML-Code direkt nach Body-Tag einbinden bluefire TYPO3 4.x Fragen und Probleme 3 07.11.07 19:58
Extension Template einbinden ClubVilla TYPO3 4.x Fragen und Probleme 1 05.11.07 18:28
Content in HTML-Template einbinden LX&R TYPO3 4.x Fragen und Probleme 0 07.11.06 16:59


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:38 Uhr.


Powered by vBulletin® Version 3.7.3 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0