Differences

This shows you the differences between two versions of the page.

deutsch:technik:aufruf-interner-funktionen:skript-in-den-head-bereich [2011/03/21 12:40]
Knut Heermann (flip-flop)
deutsch:technik:aufruf-interner-funktionen:skript-in-den-head-bereich [2018/06/03 18:08] (current)
Line 16: Line 16:
Die Prozeduren können auch in einem frontend_render-Skript abgelegt werden. Die Prozeduren können auch in einem frontend_render-Skript abgelegt werden.
-Der **Skript-Dateiname** //(here: $block['custom_htmlhead']['**...script...**'])// wird immer als Array Index verwendet.+Der **Skript-Dateiname** //(hier: $block['custom_htmlhead']['**...script...**'])// wird immer als Array Index verwendet.
-Bsp.: +Bsp. frontend_render-Skript:
<code php> <code php>
<?php <?php
Line 56: Line 56:
\\ \\
-**Ab phpwcms r411:**  
- 
- 
-Forum: [[http://forum.phpwcms.org/viewtopic.php?p=127961#p127961|…and some more too]] 
- 
-<code css> 
-   <!--CSS:  
-   #header { 
-      background: #F9E931 url(template/img/mozilla.png) no-repeat left top !important; 
-      background: #F9E931 url(template/img/mozilla.png) no-repeat left top;  
-   } 
-   -->  
-</code> 
 +<note>
 +Sollen php-Anweisungen direkt in einem Template ausgeführt werden, wird der TAG **%%[PHP]%%**%% ... Anweisungen ...%%**%%[/PHP]%%** verwendet. \\ Außerdem ist ein direkter Zugriff auf die oben gezeigt Variablen aus %%[PHP] ... [/PHP]%% nicht möglich, dazu muss dann $GLOBALS bemüht werden. \\ Bsp.: <code>$GLOBALS['block']['custom_htmlhead']['my.js']</code> anstatt <code>$block['custom_htmlhead']['my.js']</code>
 +</note>
\\ \\
Line 80: Line 70:
$GLOBALS['block']['css']['reg_tabs_accordion01_login'] = 'specific/reg_tabs_accordion01_login.css'; $GLOBALS['block']['css']['reg_tabs_accordion01_login'] = 'specific/reg_tabs_accordion01_login.css';
</code> </code>
 +
\\ \\
-**Ab phpwcms r411:** + 
 +==== Ab phpwcms r411: ==== 
 + 
 +Forum: [[http://forum.phpwcms.org/viewtopic.php?p=127961#p127961|…and some more too]] 
 + 
 +<note important> 
 +**Notation:** %%<!--%%##%% %%##%%[CSS:|JS:]%%##%% %%##Anweisung##%% %%##%%-->%%  
 + 
 +Die gekennzeichneten Leerzeichen##%% %%##  sind zwingend!! 
 +</note> 
 + 
 +=== CSS: === 
 + 
<code css> <code css>
<!-- CSS: {TEMPLATE}inc_css/my.css --> <!-- CSS: {TEMPLATE}inc_css/my.css -->
 +</code>
 +\\
 +
 +- Als Inline CSS:
 +
 +<code css>
 +<!-- CSS: body {background:yellow;} -->
 +<!-- CSS:
 +  body {
 +    background:yellow;
 +  }
 +  a {
 +    text-decoration: none;
 +    background: transparent url({TEMPLATE}img/link.png) no-repeat left center;
 +    padding-left: 25px;
 +  }
 +-->
 +</code>
 +
 +\\
 +
 +=== JavaScript: ===
 +Aktuell im Sitetemplate ausgewählte (aber nicht standardmäßig zu laden aktivierte) js-libary starten:
 +<code html>
 +<!-- JS: initJSLib -->
 +</code>
 +\\
 +- andere JS-Dateine einbinden
 +<code html>
 +<!-- JS: {TEMPLATE}inc_js/calendarDateInput/calendarDateInputX.js -->
 +<!-- JS: {TEMPLATE}inc_js/MyFolder/MyScript.js -->
 +</code>
 +
 +\\
 +- Plugins einbinden (jQuery) z.B. mit den Dateien in:
 +  * template/lib/jquery/plugin/ui-1.8.custom.min.js
 +  * template/lib/jquery/plugin/jquery.easing.min.js
 +
 +<code html>
 +<!-- JS: ui-1.8.custom.min -->
 +<!-- JS: easing.min -->
 +</code>
 +
 +\\
 +Analog dazu für MooTools :
 +
 +- Plugins einbinden z.B. MooTools 1.2x mit den Dateien in:
 +  * template/lib/mootools/plugin-1.2/mootools.flext.js
 +  * template/lib/mootools/plugin-1.2/mootools.Quickie-yui.js
 +
 +<code html>
 +<!-- JS: flext -->
 +<!-- JS: Quickie-yui -->
 +</code>
 +
 +\\
 +- Laden von More Komponenten:
 +
 +<code html>
 +<!-- JS: myplugin -->
 +<!-- JS: MORE:Fx/Fx.Elements,Fx/Fx.Accordion -->
 +</code>
 +\\
 +
 +- Mehrzeiliges JavaScript als <script /> im "head" Bereich.
 +
 +Alle gleichen JavaScript-Abschnitt wie in sich wiederholenden ContentParts einmal gerendert. \\
 +Um als JavaScript erkannt zu werden brauchen wir ##%%;%%##, ##%%//%%## und/oder ##%%/*%%##.\\
 +Der Abschluss einer JavaScript Zeile mit einem ##%%;%%## ist der sicherste Weg:
 +
 +<code html>
 +<!-- JS:
 +  // My Custom JS
 +  alert('hey dude it works as expected');
 +-->
</code> </code>
deutsch/technik/aufruf-interner-funktionen/skript-in-den-head-bereich.1300707651.txt.gz · Last modified: 2018/06/03 18:06 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0