Measures and help by the installation of my modules
First we optimize the loading time of the side. Put your Stylesheets for your layout in the area HEAD
<!-- Externes Stylesheet einbinden --> <link href="<?php echo TEMPLATE_DIR; ?>/css/my_layout.css" rel="stylesheet" type="text/css"/> <!--[if lte IE 7]> <link href="<?php echo TEMPLATE_DIR; ?>/css/patches/patch_my_layout.css" rel="stylesheet" type="text/css" /> <![endif]--> <link href="<?php echo WB_URL; ?>/framework/jquery/themes16/redmond/ui.all.css" media="screen" rel="stylesheet" type="text/css" />
Please integrate afterwards the following instruction PHP to load the modulestylesheets
<?php
if(function_exists('register_frontend_modfiles')) {
register_frontend_modfiles('css');
}
?>
Jetzt binden wir die Javascripte und Aufrufe der Funktionen vor </body> ein
<script language="JavaScript" type="text/javascript">
var URL = '<?php echo WB_URL ?>';
var URL_SLIDER = '<?php echo WB_URL ?>/modules/wysiwyg_slider/';
var horz = true;
</script>
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
<script src="<?php echo WB_URL; ?>/jquery/ui/minified/jquery-ui-min.js" type="text/javascript"></script>
<script src="<?php echo WB_URL; ?>/jquery/ui/jquery.insert.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
if($("a[rel^='lightbox']").length) {
$.insert("<?php echo WB_URL; ?>/jquery/themes16/base/jquery.slimbox2.css");
$.insert("<?php echo WB_URL ?>/jquery/ui/minified/jquery.slimbox2.min.js");
}
if($(".rounded").length) {
$.insert("<?php echo WB_URL ?>/jquery/ui/jquery.corner.js");
$(function() {
$(".rounded").corner('round 15px'); /* test for rounding */
});
}
/*-- Only for coder --*/
if($("[class^=brush]").length) {
$.insert("<?php echo WB_URL ?>/framework/dp.SyntaxHighlighter/styles/shCore.css");
$.insert("<?php echo WB_URL ?>/framework/dp.SyntaxHighlighter/styles/shThemeDefault.css");
$.insert("<?php echo WB_URL ?>/framework/dp.SyntaxHighlighter/scripts/shCore.all.js");
$(function(){
SyntaxHighlighter.config.stripBrs = false;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = "<?php echo WB_URL ?>/framework/dp.SyntaxHighlighter/scripts/clipboard.swf";
SyntaxHighlighter.defaults['gutter'] = true;
SyntaxHighlighter.defaults['smart-tabs'] = true;
SyntaxHighlighter.defaults['wrap-lines'] = true;
SyntaxHighlighter.defaults['html-script'] = true;
SyntaxHighlighter.all();
});
};
/*-- Only for coder --*/
</script>
<?php
if(function_exists('register_frontend_modfiles')) {
register_frontend_modfiles('js');
}
?>
To him we are about constantly to improve the optimization of the loading time. We reach this by the fact that Scripte and Stylesheets of our modules are loaded only by the call. Questioned they will be supposed to explain it in the source text Selectoren one certain action.
So, e.g., a box with round corners we reach in such a way
<p style="text-align: left;" class="benefits rounded"> So z. B. eine Box mit runden Ecken erreichen wir so </p>
Or other example: You would like to call a picture a la Lightbox. No Problen, see here
<a rel="lightbox" title="Aufruf eines Bildes mit jquery slimbox sctipt" href="http://www.wdsnet.de/wb/media/fotoalben/IMG_3411.JPG"><strong>hier</strong></a>
The following Scripte please at the end of the side. Thereby it is reached that the Scripte are only loaded when the side is already to be seen. If you put the Scripte in the area HEAD, the loading time increases drastically and the visitor the side perhaps would leave early.
<?php
if(file_exists(WB_PATH.'/modules/chcounter/info.php')){
include("interfaces/chcounter.php");
}
?>
<script language="JavaScript" type="text/javascript">
var URL = '<?php echo WB_URL ?>';
var URL_SLIDER = '<?php echo WB_URL ?>/modules/wysiwyg_slider/';
var horz = true;
</script>
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
<script src="<?php echo WB_URL; ?>/framework/jquery/ui/minified/jquery-ui-min.js" type="text/javascript"></script>
<script src="<?php echo WB_URL; ?>/framework/jquery/ui/jquery.insert.js" type="text/javascript"></script>
<script src="<?php echo WB_URL ?>/framework/dp.SynaxHighlighter/scripts/shLegacy.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
if($("a[rel^='lightbox']").length) {
$.insert("<?php echo WB_URL; ?>/framework/jquery/themes16/base/jquery.slimbox2.css");
$.insert("<?php echo WB_URL ?>/framework/jquery/ui/minified/jquery.slimbox2.min.js");
}
if($(".rounded").length) {
$.insert("<?php echo WB_URL ?>/framework/jquery/ui/jquery.corner.js");
$(function() {
$(".rounded").corner('round 15px'); /* test for rounding */
});
}
/*-- Only for coder --*/
if($("[class^=brush]").length) {
$.insert("<?php echo WB_URL ?>/framework/dp.SyntaxHighlighter/styles/shCore.css");
$.insert("<?php echo WB_URL ?>/framework/dp.SyntaxHighlighter/styles/shThemeDefault.css");
$.insert("<?php echo WB_URL ?>/framework/dp.SyntaxHighlighter/scripts/shCore.all.js");
$(function(){
SyntaxHighlighter.config.stripBrs = false;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = "<?php echo WB_URL ?>/framework/dp.SyntaxHighlighter/scripts/clipboard.swf";
SyntaxHighlighter.defaults['gutter'] = true;
SyntaxHighlighter.defaults['smart-tabs'] = true;
SyntaxHighlighter.defaults['wrap-lines'] = true;
SyntaxHighlighter.defaults['html-script'] = true;
SyntaxHighlighter.all();
});
};
/*-- Only for coder --*/
</script>
<?php
if(function_exists('register_frontend_modfiles')) {
register_frontend_modfiles('js');
}
?>
</body>
</html>