Menu external link open in new window specific size

Need help with the Administration of your Joomla! 1.5 site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
acpoot
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sat May 23, 2009 9:11 pm

Menu external link open in new window specific size

Post by acpoot » Sat May 23, 2009 9:19 pm

Hello every one, I'm using joomla 1.5.10 and I'm trying to put an external link that when the user make click open a new window with a specific size window, without navigation bar - scrollbars - and status bar

in dreamweaver thers's a behavior called open browser window, and give you many options to open a window, in joomla when you set a new external link only has the open in new windos without navigationbar, but where can a set the size of the window???

User avatar
pxforti
Joomla! Hero
Joomla! Hero
Posts: 2755
Joined: Wed Apr 04, 2007 8:54 pm
Location: Driggs, Idaho

Re: Menu external link open in new window specific size

Post by pxforti » Sun May 24, 2009 11:00 pm

Add the script below to your template and then create an empty css class called .popup

then you can assign that class to the link via the style menu or you can add it directly into code; eg
<a href="http://somesite.com" class="popup">link</a>

This will popup a new window of the size you specified in popup.js. You can also specifiy window options;

===================
popup.js script upload to site and add link to your template.

/*
Standards Compliant Popup Script
Author : Kevin Cannon
http://www.multiblah.com
Last Edited: 12.12.2004
Version 1.0

Searches through a document for links with the class popup.
When clicked, this link will open in a popup window.
This means you don't have to add javascript to your code,
and means the links continue to work, for search engines,
and browsers without javascript

*/


function initPopups() {

//alert("hello");

if (!document.getElementById) return

var aLinks = document.getElementsByTagName('a');

for (var i = 0; i < aLinks.length; i++) {
if (aLinks.className == 'popup') {

aLinks.onclick = function() {
var url = this.href;
openPopup(url);
return false;
}
}
}
}

// popupWindow function
// This is where you set your specific height & width etc... for your popups.
function openPopup(url) {
window.open(url, 'popupwindow', 'width=500,height=500,scrollbars,resizable');
return false;
}


// Piggy-back fucntion onto onLoad event ............................................
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}

addLoadEvent(initPopups);


/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
Joomla Website Design / CS-Cart Website Design
http://writenowdesign.com

acpoot
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sat May 23, 2009 9:11 pm

Re: Menu external link open in new window specific size

Post by acpoot » Mon May 25, 2009 1:53 am

Thanks a lot for the support I think that's a good idea, but one question that kind of link are for the articles isn't it? but for the main menu or the menus that I create in joomla when i create a new external link there are no such option to add some CSS class or I'm wrong?

The solution that you told me is in the case that i create a link in articles or create a custom html module, am I correct???

Do you know if there are some upgrading to joomla backend of the options in menu items where you can choose to open a link in same or new window and options of the size??

Hope you can understand what I'm meaning (I speak Spanish)

thanks a lot

User avatar
pxforti
Joomla! Hero
Joomla! Hero
Posts: 2755
Joined: Wed Apr 04, 2007 8:54 pm
Location: Driggs, Idaho

Re: Menu external link open in new window specific size

Post by pxforti » Mon May 25, 2009 3:18 pm

Hi, if you are creating a menu item, you can specify a target for the link: use "Open in New Window" but you won't be able to control window options with that.
Joomla Website Design / CS-Cart Website Design
http://writenowdesign.com

acpoot
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sat May 23, 2009 9:11 pm

Re: Menu external link open in new window specific size

Post by acpoot » Mon May 25, 2009 10:10 pm

Thanks a lot for the answer, I think I'll try with your js and css thanks for your tip.


But it will be nice and useful if it will be more options in menu items, don't you agree?

Cheers and thanks again

User avatar
pxforti
Joomla! Hero
Joomla! Hero
Posts: 2755
Joined: Wed Apr 04, 2007 8:54 pm
Location: Driggs, Idaho

Re: Menu external link open in new window specific size

Post by pxforti » Mon May 25, 2009 10:21 pm

I agree; it would be nice if you could add code the menu links. You should search the extensions; there might be something that would allow you to do that. Also, search the forum for an answer.
Joomla Website Design / CS-Cart Website Design
http://writenowdesign.com

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44083
Joined: Sat Apr 05, 2008 9:58 pm

Re: Menu external link open in new window specific size

Post by Webdongle » Mon May 25, 2009 11:14 pm

Use http://extensions.joomla.org/extensions ... 35/details or similar and insert:
<SCRIPT LANGUAGE="javascript">
<!--
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

-->
</SCRIPT>
Alter the scrollbars to suit.
(leave the module deactivated).

Install and activate http://extensions.joomla.org/extensions ... 58/details

Create an Article and insert
{module [xx]}</p>
<a href="http://www.google.com" onclick="NewWindow(this.href,'name','1000','400','yes');return false;">Your text here</a>
xxx = html module number.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

acpoot
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sat May 23, 2009 9:11 pm

Re: Menu external link open in new window specific size

Post by acpoot » Tue May 26, 2009 9:45 pm

thanks webdongle that's a really cool option, but in my case I've an external hmtl page (not module) that I want to open in a new window with exact size, and I've found in joomla 1.5.10 an option for articles or custom HTML, that you can insert a link (ther's a tab called popup) where you can choose to open in a new window and specify the size (this is for a external link), but my problem is not for articles or custom html, I want to do that but for links in mainmenu (joomla menu items).

link: http://www.intechcomputacion.com.mx/dweb/er/

that's the page I'm working with, you can see a [spam] module, below the module there's a link that do what I want the only problem is that I want that option in the main menu (red bar).

bt-t
Joomla! Apprentice
Joomla! Apprentice
Posts: 38
Joined: Fri Jul 24, 2009 8:35 am
Contact:

Re: Menu external link open in new window specific size

Post by bt-t » Thu Aug 06, 2009 10:59 am

pxforti wrote:Hi, if you are creating a menu item, you can specify a target for the link: use "Open in New Window" but you won't be able to control window options with that.
There is not way for changing the properties of the window???? :-)

tazzarkin
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Sun Jan 11, 2009 8:08 am

Re: Menu external link open in new window specific size

Post by tazzarkin » Sun Aug 16, 2009 2:33 am

I've been searching for the same thing for a day, and it's the exact same thing that I want to do.

I want to create a Menu Item with an external link that On Click, Opens in New Window with a "specific size".

But there is No Option for specific size. No one has an answer for this?

-----------------
bt-t wrote:
pxforti wrote:Hi, if you are creating a menu item, you can specify a target for the link: use "Open in New Window" but you won't be able to control window options with that.
There is not way for changing the properties of the window???? :-)

tazzarkin
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Sun Jan 11, 2009 8:08 am

Re: Menu external link open in new window specific size

Post by tazzarkin » Sun Aug 16, 2009 2:45 am

This is what I want to do!!!!! Any solution?!?

-------------------
acpoot wrote:thanks webdongle that's a really cool option, but in my case I've an external hmtl page (not module) that I want to open in a new window with exact size, and I've found in joomla 1.5.10 an option for articles or custom HTML, that you can insert a link (ther's a tab called popup) where you can choose to open in a new window and specify the size (this is for a external link), but my problem is not for articles or custom html, I want to do that but for links in mainmenu (joomla menu items).

link: http://www.intechcomputacion.com.mx/dweb/er/

that's the page I'm working with, you can see a [spam] module, below the module there's a link that do what I want the only problem is that I want that option in the main menu (red bar).

dudemeister
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Aug 23, 2009 10:01 pm

Re: Menu external link open in new window specific size

Post by dudemeister » Sun Aug 23, 2009 10:05 pm

pxforti wrote:Add the script below to your template and then create an empty css class called .popup

then you can assign that class to the link via the style menu or you can add it directly into code; eg
<a href="http://somesite.com" class="popup">link</a>

This will popup a new window of the size you specified in popup.js. You can also specifiy window options;

===================
popup.js script upload to site and add link to your template.

/*
Standards Compliant Popup Script
Author : Kevin Cannon
http://www.multiblah.com
Last Edited: 12.12.2004
Version 1.0

Searches through a document for links with the class popup.
When clicked, this link will open in a popup window.
This means you don't have to add javascript to your code,
and means the links continue to work, for search engines,
and browsers without javascript

*/


function initPopups() {

//alert("hello");

if (!document.getElementById) return

var aLinks = document.getElementsByTagName('a');

for (var i = 0; i < aLinks.length; i++) {
if (aLinks.className == 'popup') {

aLinks.onclick = function() {
var url = this.href;
openPopup(url);
return false;
}
}
}
}

// popupWindow function
// This is where you set your specific height & width etc... for your popups.
function openPopup(url) {
window.open(url, 'popupwindow', 'width=500,height=500,scrollbars,resizable');
return false;
}


// Piggy-back fucntion onto onLoad event ............................................
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}

addLoadEvent(initPopups);


/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}


Where is the JS file located? Or am I supposed to create a JS from the above code. If this code goes directly into the template where exactly is it supposed to be place? I'm assuming in the header.

Thanks for the help in advance!

Medley
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Jun 29, 2009 7:28 am

Re: Menu external link open in new window specific size

Post by Medley » Mon Sep 28, 2009 2:52 pm

Has anyone had any luck with this?

dudemeister
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Aug 23, 2009 10:01 pm

Re: Menu external link open in new window specific size

Post by dudemeister » Thu Oct 01, 2009 9:50 pm

Here's how I did it:

1) Create a .php file called popup.php

2) Copy the following code and paste it into popup.php:

Code: Select all

<?php

/**
* @copyright
Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.

* @license
GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// no direct access

defined( '_JEXEC' ) or die( 'Restricted access' );

?>

<script type="text/javascript">

/*
Standards Compliant Popup Script
Author : Kevin Cannon
http://www.multiblah.com
Last Edited: 12.12.2004
Version 1.0

Searches through a document for links with the class popup.
When clicked, this link will open in a popup window.
This means you don't have to add javascript to your code, 
and means the links continue to work, for search engines, 
and browsers without javascript

*/


function initPopups() {

//alert("hello");

if (!document.getElementById) return

var aLinks = document.getElementsByTagName('a');

for (var i = 0; i < aLinks.length; i++) { 
if (aLinks[i].className == 'popup') {

aLinks[i].onclick = function() {
var url = this.href;
openPopup(url);
return false;
} 
}
}
}

// popupWindow function
// This is where you set your specific height & width etc... for your popups.
function openPopup(url) { 
window.open(url, 'popupwindow', 'width=500,height=500,scrollbars,resizable'); 
return false;
}


// Piggy-back fucntion onto onLoad event ............................................
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}

addLoadEvent(initPopups);


/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
} 
else if(document.all)// ie
window.external.AddFavorite(url, title);
}

</script>
3) Save popup.php in your template folder, ie templates/ja_purity/popup.php, and upload.

4) Include popup.php into your main template by placing the following code before </head> tag:

Code: Select all

<?php include("popup.php"); ?>
</head>
5. Add class="popup" to any link and you should have a popup window. Then all you need to do is configure the script to customize your popup window.

Hope that helps. Let me know if you have any questions.

Medley
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Jun 29, 2009 7:28 am

Re: Menu external link open in new window specific size

Post by Medley » Fri Oct 02, 2009 8:38 pm

Thanks so much for your help with this Dudemeister. I have two newbie questions for you.

With step #4, what is my "main template" file? template_css.css? index.php? I can't find <head> tags in any of my files, so do I add them to one?

And with step #5, Is this what you do? In the link section put <a href="page.html" class="popup">text</a> ?

Medley
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Jun 29, 2009 7:28 am

Re: Menu external link open in new window specific size

Post by Medley » Sat Oct 03, 2009 1:53 am

I figured out step 4, it's the index.php file. but with step 5, I've tried selecting a "external link" "Menu Item Type" and putting <a href="page.html" class="popup"</a> in the link section but it doesn't work. What am I doing wrong here?

romskull
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Oct 03, 2009 2:43 pm

Re: Menu external link open in new window specific size

Post by romskull » Sat Oct 03, 2009 2:52 pm

Medley wrote:putting <a href="page.html" class="popup"</a> in the link section but it doesn't work. What am I doing wrong here?
You're very close. Realize that Joomla will put whatever you type in the 'Link' field within the two quotation marks for the href tag. So you need to fool it a bit by providing any other quotation marks needed to make this work.

So, in your Link field, you would literally put: page.html" class="popup

The first quotation mark will represent the end of you link destination. Leave off the quotation after the word 'popup', because the Joomla editor will supply it.

I tried it - it works.

Medley
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Jun 29, 2009 7:28 am

Re: Menu external link open in new window specific size

Post by Medley » Sat Oct 03, 2009 5:06 pm

That's it! Thank you so much. One other big mistake I was making was that I added

Code: Select all

<?php include("popup.php"); ?>
into the index.php when all you need to add is:

Code: Select all

include("popup.php");
before the:

Code: Select all

?>
Works like a charm. Amazing!

ecvis17
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Feb 10, 2010 1:17 pm
Location: UK
Contact:

Re: Menu external link open in new window specific size

Post by ecvis17 » Fri Apr 16, 2010 7:43 am

Everyone thank you very much, this is such a smooth solution. It is as if it becomes a joomla core tool when you use this. Works across the whole site simply by adding a class. wow

soccerrprp
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Fri May 28, 2010 10:27 am

Re: Menu external link open in new window specific size

Post by soccerrprp » Fri May 28, 2010 11:09 am

great information! Exactly what I was looking for!

User avatar
baijianpeng
Joomla! Guru
Joomla! Guru
Posts: 516
Joined: Mon Mar 20, 2006 3:17 pm
Location: China
Contact:

Re: Menu external link open in new window specific size

Post by baijianpeng » Fri Oct 01, 2010 2:53 pm

romskull wrote: You're very close. Realize that Joomla will put whatever you type in the 'Link' field within the two quotation marks for the href tag. So you need to fool it a bit by providing any other quotation marks needed to make this work.

So, in your Link field, you would literally put: page.html" class="popup
Great trick!

This idea helped me!

Thank you very much!
JoomlaGate - Chinese Joomla Users' Portal

http://www.joomlagate.com

thepopstar
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Feb 14, 2011 12:33 pm

Re: Menu external link open in new window specific size

Post by thepopstar » Mon Feb 14, 2011 12:50 pm

so im trying this out but having a slight problem.... i am using the GK Sporter template to do this process and it is built solely on CSS and there doesnt apear to be a real form of html here. i am not sure where to place this code in the index.php file

here is what the code in the index.php file looks like if someone could please show me how to paste this or where id be very appreciative

when i try the code as described it gives this error
Username

Password

Remember Me

* Forgot your password?
* Forgot your username?
* Create an account

Name: *
Username: *
Email: *
Password: *
Verify password: *

* Field is required

Register

Warning: include(popup.php) [function.include]: failed to open stream: No such file or directory in /home/content/53/6719453/html/ja/index.php on line 89

Warning: include() [function.include]: Failed opening 'popup.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/53/6719453/html/ja/index.php on line 89


here is what the source files look like for my index.php file



<?php
/**
* @version $Id: index.php 14401 2010-01-26 14:10:00Z louis $
* @package Joomla
* @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// Set flag that this is a parent file
define( '_JEXEC', 1 );

define('JPATH_BASE', dirname(__FILE__) );

define( 'DS', DIRECTORY_SEPARATOR );

require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );

JDEBUG ? $_PROFILER->mark( 'afterLoad' ) : null;

/**
* CREATE THE APPLICATION
*
* NOTE :
*/
$mainframe =& JFactory::getApplication('site');

/**
* INITIALISE THE APPLICATION
*
* NOTE :
*/
// set the language
$mainframe->initialise();

JPluginHelper::importPlugin('system');

// trigger the onAfterInitialise events
JDEBUG ? $_PROFILER->mark('afterInitialise') : null;
$mainframe->triggerEvent('onAfterInitialise');

/**
* ROUTE THE APPLICATION
*
* NOTE :
*/
$mainframe->route();

// authorization
$Itemid = JRequest::getInt( 'Itemid');
$mainframe->authorize($Itemid);

// trigger the onAfterRoute events
JDEBUG ? $_PROFILER->mark('afterRoute') : null;
$mainframe->triggerEvent('onAfterRoute');

/**
* DISPATCH THE APPLICATION
*
* NOTE :
*/
$option = JRequest::getCmd('option');
$mainframe->dispatch($option);

// trigger the onAfterDispatch events
JDEBUG ? $_PROFILER->mark('afterDispatch') : null;
$mainframe->triggerEvent('onAfterDispatch');

/**
* RENDER THE APPLICATION
*
* NOTE :
*/
$mainframe->render();

// trigger the onAfterRender events
JDEBUG ? $_PROFILER->mark('afterRender') : null;
$mainframe->triggerEvent('onAfterRender');

/**
* RETURN THE RESPONSE
*/
echo JResponse::toString($mainframe->getCfg('gzip'));
include("popup.php");

thepopstar
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Feb 14, 2011 12:33 pm

Re: Menu external link open in new window specific size

Post by thepopstar » Mon Feb 14, 2011 1:09 pm

i believe line 89 is the include script. its the very last line.
include("popup.php");

thepopstar
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Feb 14, 2011 12:33 pm

Re: Menu external link open in new window specific size

Post by thepopstar » Mon Feb 14, 2011 1:19 pm

ok so i figured out the issue. sorry kinda a newb at this.. i placed the
popup.php in the joomla/template/templatename/popup.php directory..
where as it should have been placed in:
joomla/popup.php directory. thanks for the codes :)

thepopstar
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Feb 14, 2011 12:33 pm

Re: Menu external link open in new window specific size

Post by thepopstar » Mon Feb 14, 2011 1:21 pm

however apon further inspection.. all that did was remove the error code so the files in thoery are in the right place, but there is no functionality to the pop up just an external window link..
any ideas

nicmehr
I've been banned!
Posts: 36
Joined: Fri Feb 04, 2011 12:19 pm

Re: Menu external link open in new window specific size

Post by nicmehr » Mon Feb 14, 2011 1:24 pm

i dont think line 89 is the last line
if it is popup.php
please send source of popup.php

thepopstar
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Feb 14, 2011 12:33 pm

Re: Menu external link open in new window specific size

Post by thepopstar » Mon Feb 14, 2011 1:32 pm

include("popup.php"); is the 89th line in the index.php file
here is the source for
popup.php

<?php

/**
* @copyright
Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.

* @license
GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// no direct access

defined( '_JEXEC' ) or die( 'Restricted access' );

?>

<script type="text/javascript">

/*
Standards Compliant Popup Script
Author : Kevin Cannon
http://www.multiblah.com
Last Edited: 12.12.2004
Version 1.0

Searches through a document for links with the class popup.
When clicked, this link will open in a popup window.
This means you don't have to add javascript to your code,
and means the links continue to work, for search engines,
and browsers without javascript

*/


function initPopups() {

//alert("hello");

if (!document.getElementById) return

var aLinks = document.getElementsByTagName('a');

for (var i = 0; i < aLinks.length; i++) {
if (aLinks.className == 'popup') {

aLinks.onclick = function() {
var url = this.href;
openPopup(url);
return false;
}
}
}
}

// popupWindow function
// This is where you set your specific height & width etc... for your popups.
function openPopup(url) {
window.open(url, 'popupwindow', 'width=500,height=500,scrollbars,resizable');
return false;
}


// Piggy-back fucntion onto onLoad event ............................................
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}

addLoadEvent(initPopups);


/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}

</script>

thepopstar
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Feb 14, 2011 12:33 pm

Re: Menu external link open in new window specific size

Post by thepopstar » Tue Feb 15, 2011 5:22 am

can anyone help with this? i would like to be able to make an external popup as i am building a radio station website and i need to have an external flash player but cant seem to figure out how to get joomla to do this from a link in a menu. any help please

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44083
Joined: Sat Apr 05, 2008 9:58 pm

Re: Menu external link open in new window specific size

Post by Webdongle » Tue Feb 15, 2011 12:48 pm

http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

thepopstar
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Feb 14, 2011 12:33 pm

Re: Menu external link open in new window specific size

Post by thepopstar » Wed Feb 16, 2011 1:09 pm

webdongle not sure what this is for but this doesnt hsolve my issue


Locked

Return to “Administration 1.5”