Zum Inhalt springen

php in einem template??

Erstellt am 18. August 2004 · 21 Antworten · letzte Antwort am 20. August 2004 · Seite 1 von 2

Tags: Frage

l00P ·

der heißt wohl PHP aber NOCHMAL: wie binde ich das ein?

so: ###php### $ptint "xyz" ###php###

oder so <?php $print "xyz" ?>

oder wie??????
bitte ein beispiel..

danke

doku ·

überleg doch erstmal, was der/dein ts-code überhaupt bedeutet:

- mit dem code bindet man eine php-datei ein.
- deine "persönliche" php-datei heißt ja angeblich script.php
- sie liegt angeblich in deinem root-verzeichnis. (sie sollte aber besser in einem ordner unterhalb von fileadmin liegen, den pfad mußt du dann natürlich noch anpassen, also z.b.: fileadmin/scripts/script.php)
- du hast einen marker namens PHP definiert
- du hast angegeben, daß an der stelle des markers deine php-datei eingesetzt wird.
- diesen marker schreibst du natürlich in dein html-template. machst du mit allen anderen markern ja auch.
- dieser marker wird ersetzt durch deine datei

mir scheint, du hast da was ganz grundsätzliches nicht kapiert... 😉

l00P ·

...nein geht leider nicht.

hab das script.php an die richtige stelle auf den server gelegt.

hab die beiden zeilen in das setupfeld ganz oben eingebunden.

hab die marker im template gesetzt <!--###PHP###-->
wied aber nix eingebunden. die marker sehe ich im sourcecode, sind aber leer!!

woran kann das liegen???

doku ·

wenn du den marker in einem kommentar versteckst, wird er natürlich nicht dargestellt, is doch logisch.

l00P ·

wenn ich die kommentare wegnehme steht auf der website:

###PHP######PHP###

funkt also anscheinend auch nicht!!

Dander ·

Du hast die beiden Zeilen ganz oben eingebunden??

Poste mal dein setup bitte,

weil diese beiden zeilen:

marks.PHP = PHP_SCRIPT
marks.PHP.file = script.php

sollten schon so in der art ausehen

page.10.marks.PHP = PHP_SCRIPT
page.10marks.PHP.file = script.php

wenn du sie ganz oben einbindest

doku ·

dann poste dein komplettes ts, an diesem codeschnipsel liegt es es jedenfalls nicht.

p.s.: ein marker reicht ja wohl, oder willst du dein skript etwa zweimal hintereinander einbinden? 😉

l00P ·

das ist mein setup field:

marks.PHP = PHP_SCRIPT
marks.PHP.file = fileadmin/template/script.php

# Configuring the Auto-Parser for main template:
plugin.tx_automaketemplate_pi1 {

# Read the template file:
content = FILE
content.file = fileadmin/template/template.htm

# Here we define which elements in the HTML that
# should be wrapped in subpart-comments:
elements {
BODY.all = 1
BODY.all.subpartMarker = DOCUMENT_BODY
HEAD.all = 1
HEAD.all.subpartMarker = DOCUMENT_HEADER
HEAD.rmTagSections = title

TD.all = 1

}

# Prefix all relative paths with this value:
relPathPrefix = fileadmin/template/
}

#####menueBegin
# Menu 1 cObject

temp.menu_1 = HMENU

# First level menu-object, textual
temp.menu_1.1 = TMENU
temp.menu_1.1 {

# Normal state properties
NO.allWrap = <div class="menu1-level1-no"> | </div>

# Enable active state and set properties:
ACT = 1
ACT.allWrap = <div class="menu1-level1-act"> | </div>
}

# Second level menu-object, textual
temp.menu_1.2 = TMENU
temp.menu_1.2 {

# Normal state properties
NO.allWrap = <div class="menu1-level2-no"> | </div>

# Enable active state and set properties:
#ACT = 1
#ACT.allWrap = <div class="menu1-level2-act"> | </div>
}
#####menueEnd

# Main TEMPLATE cObject for the BODY
temp.mainTemplate = TEMPLATE
temp.mainTemplate {

# Feeding the content from the Auto-parser to the TEMPLATE cObject:
template =< plugin.tx_automaketemplate_pi1

# Select only the content between the <body>-tags
workOnSubpart = DOCUMENT_BODY

# Substitute the ###menu_1### subpart with dynamic menu:
subparts.menu_1 < temp.menu_1

# Substitute the ###content### subpart with some example content:
subparts.content < styles.content.get
}

# Main TEMPLATE cObject for the HEAD
temp.headTemplate = TEMPLATE
temp.headTemplate {

# Feeding the content from the Auto-parser to the TEMPLATE cObject:
template =< plugin.tx_automaketemplate_pi1

# Select only the content between the <head>-tags
workOnSubpart = DOCUMENT_HEADER
}

# Default PAGE object:
page = PAGE
page.typeNum = 0

# Copying the content from TEMPLATE for <body>-section:
page.10 < temp.mainTemplate

# Copying the content from TEMPLATE for <head>-section:
page.headerData.10 < temp.headTemplate

doku ·
...
# Select only the content between the -tags 
workOnSubpart = DOCUMENT_BODY 

marks.PHP = PHP_SCRIPT 
marks.PHP.file = fileadmin/template/script.php 
...
l00P ·

😃 @doku: so hat das jetzt geklappt, allerdings steht der ausgegebene code am seitenanfang auf der website und nicht wo ich die marker gesetzt hatte.

l00P ·

:o hmmm komisch. Anscheinend werden meine marker ignoriert, wenn ich die wegnehme wird das php auch ausgegeben???

ich habe im cource code nachgesehen und da sing gar keine marker, auch nicht für head und für body.

ich habe aber diese autoparser extention installiert??

l00P ·

Auf ein neues.

Kann mir in dieser Angelegenhiet noch jemand ein bißchen weiterhelfen??

Bitte, danke,

lg
l00P