vjstech
asked on
Opening internal links (e.g. to pdf documents) in a new window.
Hi,
I have added the line $wgExternalLinkTarget = '_blank' to LocalSettings.php so that external links open in a new windows and this works fine. I also want to open internal links, e.g. PDF links in the same way. Is there an easy solution to this, similar to external links?
I have added the line $wgExternalLinkTarget = '_blank' to LocalSettings.php so that external links open in a new windows and this works fine. I also want to open internal links, e.g. PDF links in the same way. Is there an easy solution to this, similar to external links?
ASKER
Hi Lenamtl,
Thanks for your response.
On the MediaWiki page the pdf is added in the following format:
==== [[Media:PDF Name Here]] some other text here ====
How do I apply the tags in your answer to the existing format?
Thanks for your response.
On the MediaWiki page the pdf is added in the following format:
==== [[Media:PDF Name Here]] some other text here ====
How do I apply the tags in your answer to the existing format?
ASKER
Problem solved.
I needed to install an extension (LinkTarget), modify the localsettings.php file with the code below:
#Add Link Target
require_once "$IP/extensions/LinkTarget /LinkTarge t.php";
$wgLinkTargetParentClasses = array( 'ext-link' );
and then wrap the media link with a span tag.
<span class="ext-link"> [[Media:MyFile.pdf|My Link Text]] </span>
Opens in a new tab now.
I needed to install an extension (LinkTarget), modify the localsettings.php file with the code below:
#Add Link Target
require_once "$IP/extensions/LinkTarget
$wgLinkTargetParentClasses
and then wrap the media link with a span tag.
<span class="ext-link"> [[Media:MyFile.pdf|My Link Text]] </span>
Opens in a new tab now.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The way PDF open is based on user browser settings and you don't have control on that.
This setting can also be set in software settings for example PDF reader may have a setting for that.
If the PDF is already generated and located on your server then
Open in new window
will work or not depending of the user settings.