WebsiteBaker Support (2.8.x) > Diskussion über WB (closed)

WYSIWYG TAB mit Header

<< < (10/16) > >>

Luisehahne:
It works?

Dietmar

crnogorac081:
yes, this is the code required for WB 2.8 RC1


--- Code: ---<link href="<?php echo WB_URL; ?>/include/jquery/plugins/jquery-ui.css" media="screen" rel="stylesheet" type="text/css" />
<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; ?>/include/jquery/jquery-ui-min.js" type="text/javascript"></script>
<script src="<?php echo WB_URL; ?>/include/jquery/jquery-insert.js" type="text/javascript"></script>
<?php
if(function_exists(&#39;register_frontend_modfiles&#39;)) {
  register_frontend_modfiles(&#39;css&#39;);
    register_frontend_modfiles(&#39;js&#39;);
}
?>

--- End code ---

the register_frontend_m odfiles function must be below these scripts to work..

Also I dont understant why is this:

--- Code: ---<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>

--- End code ---
required, as I dont use SLIDER (only TAB and QUERY tested at moment) but if I remove it, it doesnt work :)

Luisehahne:
That are javascriptvariables needed for some modules by me. Because if i use the insert script in the external frontend.js i need this variables. In exyternal script no php variables can be used.

Dietmar

doc:
Hi,

maybe one should consider to add the following Javascript variables per default for usage in own modules.

--- Code: ---<script  type="text/javascript" language="JavaScript">
<!--
var WB = {
  PATH : '<?php echo WB_PATH; ?>',
  URL : '<?php echo WB_URL; ?>' ,
  ADMIN_PATH : '<?php echo ADMIN_URL; ?>',
  ADMIN_URL : '<?php echo ADMIN_URL; ?>'
};
//-->
</script>

--- End code ---

This would allow to access WB variables from Javascript (e.g. by WB.PATH, WB.URL, WB.ADMIN_URL ...) in a more convenient way than today.

The code above could be added to the register_modfile_fu nctions routine to create those variables automatically if register_modfiles(xxx.js) is invoked from the template. Same is true for the WB backend.

Doc

Luisehahne:
Super Doc,

Gute Idee. Was ist nur, wenn du es in jedder module frontend.js einbindest. Übertrieben gesagt, wird es dann tausend mal gesetzt. Einmal im Template reicht doch. Oder hattest du andere Gedanken?

Dietmar

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version