monperrus / bibtexbrowser

Beautiful publication lists with bibtex and PHP (standalone or in Wordpress)
http://www.monperrus.net/martin/bibtexbrowser/
84 stars 54 forks source link

Open links in a new page #130

Closed silarri closed 11 months ago

silarri commented 11 months ago

When there are "url" fields in the entries of the .bib file, the HTML code generated includes the URL like this:

<a href="URL">...

Is there any way to force opening the URL in a new window? This could be solved, for example, if the HTML code generated includes the following attribute in the anchor element:

target="_blank"

This would be very useful because I am showing the publications in a frame and the browser (I tried with Firefox and IE) is not able to show the contents of the pages referenced by the links within that frame, for security reasons. Therefore, the links should be opened in a new window.

monperrus commented 11 months ago

Yes, see option BIBTEXBROWSER_LINKS_TARGET

// should pdf, doi, url, gsid links be opened in a new window?
@define('BIBTEXBROWSER_LINKS_TARGET','_self');// can be _blank (new window), _top (with frames)

so you can put in bibtexbrowser.local.php

<?php
@define('BIBTEXBROWSER_LINKS_TARGET','_blank');
?>
silarri commented 11 months ago

Thanks a lot! This solves the problem.