Problem, adding javascript popup function in template head

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
Defix
Forum Members
Forum Members
Posts: 20
Joined: Thu May 18, 2006 1:29 pm

Problem, adding javascript popup function in template head

Post by Defix »

I use cmsms 0.12.2-multilang-beta1
When I copy ImageGallery tag popup javascript in template head and want to preview template says: Access Denied

Anyone can help me?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Problem, adding javascript popup function in template head

Post by Dr.CSS »

what code did you use...
you know what does it look like, how did you put it in?...
input more input...
Defix
Forum Members
Forum Members
Posts: 20
Joined: Thu May 18, 2006 1:29 pm

Re: Problem, adding javascript popup function in template head

Post by Defix »

I use ImageGallery tag popup code, I find it bottom the ImageGallery tag help page.
# type e.g. type="click" or type="popup"
For the "popup" function to work you need to include the popup javascript into the head of your template e.g. "". The javascript is at the bottom of this page! The default is 'click'.

The popup javascript

Code: Select all

{literal}
<__script__ type="text/javascript">
<!--
function PopupPic(bigPic,title,w,h) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	var smarty_hack = 'head';
	newWindow = window.open('',title,'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable=0,scrollbars=0');
	newWindow.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
	newWindow.document.write('<__html><head><title>'+title+'</title>');
	newWindow.document.write('<meta http-equiv="content-type" content="text/html; charset=UTF-8" />');
	newWindow.document.write('<style type="text/css"><!-- html, body {margin: 0px; background-color: #000;} --></style>');
	newWindow.document.write('</'+smarty_hack+'></__body onclick="self.close()">');
	newWindow.document.write('<p><img src="'+bigPic+'" alt="'+title+'" /></p>');
	newWindow.document.write('<__body></__html>');
	newWindow.document.close();
	newWindow.focus();
}
-->
</__script>
{/literal}

I insert it into my template " here ".
And Access denied
Last edited by Defix on Fri Jun 02, 2006 11:24 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Problem, adding javascript popup function in template head

Post by Dr.CSS »

have you tried it without the {literal} tags?
Defix
Forum Members
Forum Members
Posts: 20
Joined: Thu May 18, 2006 1:29 pm

Re: Problem, adding javascript popup function in template head

Post by Defix »

Yes I try, but same thing >:(
Cant understand, whats wrong. I try to put the popup script directly in template, but nothing.
Then I go to Content > Global Content Block and add popup script in new Global Content Block. When I press submit button: white page with Access Denied message.

Whats wrong whit that popup script???
JavaScript for IE page width in Global Content Block works fine and I can edit it all ok?
Defix
Forum Members
Forum Members
Posts: 20
Joined: Thu May 18, 2006 1:29 pm

Re: Problem, adding javascript popup function in template head

Post by Defix »

Not working even 0.13 Final version :P
Please step by step instruction how to include ImageGallery tag popup javascript in page template!
The script is bottom in ImageGallery tag help page.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Problem, adding javascript popup function in template head

Post by Dr.CSS »

you are Right the thing don't work...
tried it here.... no white page denial but not working...  http://www.multiintech.com/index.php?page=image_gallery
second gallery down

with it in the head and as an external script...
Post Reply

Return to “Layout and Design (CSS & HTML)”