Print

Print


Okay, to all that are interested, here is my round-about solution:

I made a PHP file with the following, lets say its under 'apps/index.php' :
------------------------------------------------------------------------
<?php

echo "

<!cript language='Javascript'>

window.open('" . $_GET['url'] . "&focus=yes','newwindow');

history.go(-1);

</script>

";

?>
------------------------------------------------------------------------
Then, you change the link in your defaultmenu.html to read:    
"http://uvm.edu/~whatever/apps/index.php?url=http://uvm.edu/~anotherwhatever/"

The only issue is that the current page stays the same, and a new page 
is opened, but the page with the link that stays the same becomes the 
focus of the browser. I couldn't figure out how to fix it in the current 
app... so I added another magicscript hack to my local magicscript.php 
file... in the very beginning I say:
------------------------------------------------------------------------
if($_GET['focus'] == 'yes'){
    echo "<!cript language='Javascript'>self.focus();</script>";
}
------------------------------------------------------------------------
Keep in mind the Web Team does NOT support hacks in the magiscript.php 
file, so use this at your own risk. That just checks to see if the file 
was opened via a link, and if it was it focuses it. Very simple. This 
also assumes you control the site you are linking to, if you do not (say 
you wanted to open Google.com in a new window) it will unfortunately 
open in the background.

That is unless someone knows how to make the history.go(-1); work using 
the blur() method in javascript.

Tyler



Rachel Sauerwein wrote:
> Tyler,
>
> I would be interested. Thank you.
>
> Rachel
>
>
> Tyler Whitney wrote:
>> Thanks very much for the reply. It is disappointing... as my two 
>> sites are both UVM sites too that are related.
>>
>> I'm currently working on the application I described, it is basically 
>> a PHP file that will open a new window with the requested page, and  
>> then itself go back to the page it came from. The only issue I've run 
>> into so far is that the current page takes the focus, and not the new 
>> window that opens. I am still working on the focus issues, but 
>> hopefully will have them resolved.
>>
>> Let me know if you are interested in such a thing.
>>
>> Tyler
>>
>> Rachel Sauerwein wrote:
>>> Hi,
>>>
>>> I inquired about this earlier this year because I maintain two 
>>> related sites at UVM and wanted to link them to each other in the 
>>> default menu.  I was told by the web team that I can't have a menu 
>>> link open in a new menu with the template for accessibility reasons.
>>>
>>> Rachel Sauerwein
>>>
>>>
>>> Tyler Whitney wrote:
>>>> Hi all,
>>>>
>>>> I'm wondering if anyone has experienced the need to change the 
>>>> target for default menu links on their UVM Template websites. For 
>>>> instance, I want to include a link in my default menu to an outside 
>>>> site, but I'd want it to open in a new window. I can't simply use 
>>>> target='_blank' because of the nature of the defaultmenu.html.
>>>>
>>>> My only other solution is to create a small application with 
>>>> Javascript and PHP that opens a new window based on the URL passed 
>>>> to the php file, and then maintain the current page. This will 
>>>> work, however, the focus of the different windows becomes an issue 
>>>> that needs to be resolved.
>>>>
>>>> I am curious as to whether there is a property in the template that 
>>>> allows me to easily change the target of such a thing.
>>>>
>>>> Tyler
>>>>
>>>
>>
>

-- 

Tyler Whitney
IT Support Specialist
Department of Residential Life
The University of Vermont
Robinson Hall, 406 South Prospect Street
Burlington, VT 05405-0364

Phone: (802)656-7937; Fax: (802)656-1142; Cell: (518)335-3196
E-mail: [log in to unmask]

Staff IT Line; (805)656-7934  
Submit a Footprint; http://reslife.uvm.edu/staffit
Submit a Website Issue/Problem; http://reslife.uvm.edu/bugs