WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

You are not logged in.

#1 24.03.2017 09:32:27

ecology
Member

Template Script's Wahn

Hi Zusammen

Eigentlich habe ich mein Template selber aufgebaut und dabei möglichst auf die verwendung von vielen Scripts verzichtet.
Wenn ich jetzt anschaue, welche Script's da alle reingeladen werde, verstehe ich nicht mehr ganz für was das alles ist.

Ev kann mir jemand erklären für was das alles gelistet wird.

Hier ein Auszug aus dem Template:

[== PHP ==]
<?php
  if(!defined('WB_URL')) {
    header('Location: ../index.php');
    exit(0);
}
$dontcount = array (999,998);
if (in_array(PAGE_ID,$dontcount)==false) {
$includefile = WB_PATH . '/modules/wbstats/count.php';
if (file_exists($includefile)) {
    include_once $includefile;
}
} 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="de" xml:lang="de" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php page_title('', '[PAGE_TITLE] - [WEBSITE_TITLE]'); ?></title>
<meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible">
	
<meta http-equiv="Content-Type" content="text/html; charset=<?php if(defined('DEFAULT_CHARSET')) { echo DEFAULT_CHARSET; } else { echo 'ISO-8859-1'; }?>" />
<meta name="description" content="<?php page_title('', '[PAGE_TITLE], [WEBSITE_TITLE]'); ?>, <?php page_description(); ?>" />
<meta name="keywords" content="<?php page_title('', '[PAGE_TITLE]'); ?>, <?php page_keywords(); ?>" />
<meta name="author" content="Raphael Opizzi" />
<link type="text/css" href="<?php echo TEMPLATE_DIR; ?>/css/bw.css" rel="stylesheet" media="screen" />

<script type="text/javascript" src="<?php echo TEMPLATE_DIR; ?>/js/prototype.js"></script>
<script type="text/javascript" src="<?php echo TEMPLATE_DIR; ?>/js/scriptaculous.js"></script>

<?php
// this allows to include the optional module files (frontend.css, frontend.js) into the head section
if(function_exists('register_frontend_modfiles')) {
  register_frontend_modfiles('css');
  register_frontend_modfiles('js');
  register_frontend_modfiles('jquery');
} ?>
<!-- Block Head Start -->
<?php page_content(3); ?>
<!-- Block Head Ende -->
</head>
<body>
...

und das bekomme ich dann alles ausgegeben:

<script type="text/javascript" src="http://www.---.ch/templates/ballonwoche/js/prototype.js"></script>
<script type="text/javascript" src="http://www.---.ch/templates/ballonwoche/js/scriptaculous.js"></script>

<script src="http://www.---.ch/modules/colorbox/frontend.js" type="text/javascript"></script>
<script src="http://www.---.ch/modules/droplets/js/mdcr.js" type="text/javascript"></script>
<script type="text/javascript">
var URL = 'http://www.---.ch';
var WB_URL = 'http://www.---.ch';
var TEMPLATE_DIR = 'http://www.---.ch/templates/ballonwoche';
</script>
<script src="http://www.---.ch/include/jquery/jquery-min.js" type="text/javascript"></script>
<script src="http://www.---.ch/include/jquery/jquery-insert.js" type="text/javascript"></script>
<script src="http://www.---.ch/include/jquery/jquery-include.js" type="text/javascript"></script>
<script src="http://www.---.ch/include/jquery/jquery_theme.js" type="text/javascript"></script>
<!-- Block Head Start -->
<!-- Block Head Ende -->
</head>
<body>
...

Vielen Dank für eure Unterstützung
Gruss Raffi

Offline

#2 24.03.2017 10:10:43

cwsoft
Member

Re: Template Script's Wahn

Hi,

die Inkludes kommen von den register_frontend_modfiles() Funktionsaufrufen. Die ersten beiden Aufrufe schauen nach, welche Module für die angezeigte Seite verwendet werden und bindet deren frontend.css und frontend.js Dateien in den <head> Bereich ein, falls diese Dateien in den jeweiligen Modulordnern vorhanden sind.

Die dritte Zeile bindet jQuery und jQueryUI ein. Wenn Du das nicht brauchst, kannst Du diese Zeile ausdokumentieren (// Kommentar), bzw. löschen. Zumal Du händisch die JavaScript Bibliothek Prototyp einbindest. Der Code weiter oben bindet das wbstats Modul ein.

Last edited by cwsoft (24.03.2017 10:35:52)


Account inactive since 2018/11/17.

Offline

Liked by:

florian, grindmobil

#3 30.03.2017 07:35:56

ecology
Member

Re: Template Script's Wahn

hi cwsoft

was mich nun noch etwas stutzig macht ist, dass im IE ein Debugging gewünscht wird:

HTML1300: Navigation wurde ausgeführt.
ballonwoche.php
SCRIPT1002: Syntaxfehler
jquery.colorbox-min.js (1,1)
SEC7113: Das CSS wurde aufgrund eines MIME-Typenkonflikts ignoriert.
404.php
SCRIPT438: Das Objekt unterstützt die Eigenschaft oder Methode "colorbox" nicht
frontend.js (48,21)

so wie ich das verstehe, ist in der jquery.colorbox.min.js etwas nicht richtig...

und im quellcode kommen diese zum Vorschein:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
<script src="[object URL]/modules/colorbox/js/jquery.colorbox-min.js" type="text/javascript"></script>
<link href="[object URL]/modules/colorbox/1/colorbox.css" rel="stylesheet" type="text/css">

dieses "object URL" ist doch nicht korrekt...???

Gruss Raffi

Last edited by ecology (30.03.2017 13:34:20)

Offline

Board footer

up