Wednesday, January 27, 2010

PROGRAMMING: Hyperlinks in new or same window

Q: We have publications with active hyperlinks pointing to our own web site and others pointing external companies' web sites. We want that 'external' links open in a new window and the ones pointing to us should open in the same window. Can we do this?

A: Yes, you can.
Open the Javascript file 'custom.js' in a plain text editor and locate the lines:
// ******* re-target links
//         check, if links not pointing to this host address should be openened in new window (_target="_blank")
var open_url_in_new_window = ""; // set to someting like ".mydomain.com"
Set the variable 'open_url_in_new_window' to your own domain name.
All links NOT containing the given string will be opened in a new window.
Yes, kind of confusing but thats how it is :)

All user adjustable programs can be found in the folder 'XSLCSS' within the 'Export folder structure.
The 'XSLCSS' master folder is in the installed software package with the folder 'BatchXSLT4InDesign/BatchXSLT/XSL'.

1 comment:

CyBrainX said...

Do you know where I can find 'custom.js'. I'm on Mac OSX 10.6.