Client Support
cancel

TRIM Web Publisher - Opening Targets In New Windos

SOLVED
Go to solution
Highlighted
Blair_Johnson
New Member.

TRIM Web Publisher - Opening Targets In New Windos

Hello all,

 

We are looking at using TRIM's Web Publisher.  I am playing with the HTML and am having a heck of a time trying to have my documents open in new windows.  Does anyone know the proper syntax?  target="_blank" does not seem to be working - but maybe I am using it incorrectly.

 

  <tr>
    <td style="text-align:center"><!--TRIM detail="Container" target="_blank"--></td>
    <td><!--TRIM field="ContainerTitle"--></td>
  </tr>

 

Thanks in advance.

 

Blair Johnson

City of Kingston

Ontario, Canada

3 REPLIES
EWillsey
Acclaimed Contributor.
Solution

Re: TRIM Web Publisher - Opening Targets In New Windos

You can't change the definition of the tag... though you can change the HTML.

Put this between "<title>" and "</head>":

 

<script>
function ForceLinks()
{
   var aLinks= document.getElementsByTagName('a').length; 
   var links=document.getElementsByTagName('a');
   for(var i = 0; i < aLinks; ++i){
      links[i].setAttribute('target','_blank');
   }
}
</script>

 
And then replace the Body line with this:

<body onload="ForceLinks();">

 




And there ya go! Note only works if javascript is enabled.

Cheers,
Erik

Blair_Johnson
New Member.

Re: TRIM Web Publisher - Opening Targets In New Windows

Wow!  Thanks!  Works perfect!  This was my first time dabbling in HTML.  Good learning experience.

 

Thanks again,

 

Blair Johnson

EWillsey
Acclaimed Contributor.

Re: TRIM Web Publisher - Opening Targets In New Windows

You're welcome! Mark it as solved if that does everything you need. :)