file block that opens to new tab? - RESOLVED

Permalink
Is there a way to get the core file block to open up the file in a new tab? There aren't really any options other than choosing what text you want for the link.

I'm not yet very good with php but in view.php of the core block I see this...

<?php defined('C5_EXECUTE') or die("Access Denied.");
$f = $controller->getFileObject();
$fp = new Permissions($f);
if ($fp->canViewFile()) {
$c = Page::getCurrentPage();
if($c instanceof Page) {
$cID = $c->getCollectionID();
}
?>

Can I modify this code to produce the result I'm looking for and, if so, where do i copy the file to in the local directory to override the core files? Any help would be great.

lackadaize
 
lackadaize replied on at Permalink Reply
lackadaize
nevermind I figured it out. After that line of code is....

<a href="<?php echo View::url('/download_file', $controller->getFileID(),$cID) ?>"><?php echo stripslashes($controller->getLinkText()) ?></a>

which I changed to...

<a href="<?php echo View::url('/download_file', $controller->getFileID(),$cID) ?>" target="_blank"><?php echo stripslashes($controller->getLinkText()) ?></a>

...then I copied the file into the /blocks file to override it.