Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2 from REHvision/patch-1
Browse files Browse the repository at this point in the history
Correct globalFolder-URLs also on multi-lang sites
  • Loading branch information
dpschen authored Apr 30, 2017
2 parents b000389 + a4e5b9d commit 5fa4783
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions site/tags/plyrtag.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
// check if should use globalVideoFolder
if (c::get('plyrtag.globalVideoFolder', false) == true) {
$globalVideoFolderName = c::get('plyrtag.globalVideoFolderName', 'video');
$baseVideoPath = $tag->page()->site()->url() . url($globalVideoFolderName . '/');
if ($tag->page()->site()->languages()) { // multi-language site
$baseVideoPath = $tag->page()->site()->language()->url() . '/' . $globalVideoFolderName . '/';
} else { // single-language site
$baseVideoPath = $tag->page()->site()->url() . '/' . $globalVideoFolderName . '/';
}
} else {
$baseVideoPath = $tag->page()->url() . '/';
}
Expand Down Expand Up @@ -76,7 +80,11 @@
// check if should use globalAudioFolder
if (c::get('plyrtag.globalAudioFolder', false) == true) {
$globalAudioFolderName = c::get('plyrtag.globalAudioFolderName', 'audio');
$baseAudioPath = $tag->page()->site()->url() . url($globalAudioFolderName . '/');
if ($tag->page()->site()->languages()) { // multi-language site
$baseAudioPath = $tag->page()->site()->language()->url() . '/' . $globalAudioFolderName . '/';
} else { // single-language site
$baseAudioPath = $tag->page()->site()->url() . '/' . $globalAudioFolderName . '/';
}
} else {
$baseAudioPath = $tag->page()->url() . '/';
}
Expand Down

0 comments on commit 5fa4783

Please sign in to comment.