Skip to content

Commit

Permalink
ADD: Relative episode link function
Browse files Browse the repository at this point in the history
MINOR: Fix missing tag open
  • Loading branch information
Luke Edwards committed Nov 10, 2016
1 parent fba8fad commit 1f651c2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ The podcast page uses [mediaelement.js](http://mediaelementjs.com/) to support c
Mediaelement.js was the best solution I could find for supporting single video/audio files over multiple browsers, but feel free to edit the module to use your own solution.

## Contact
Feel free to email me at <luke@lukeedwards.co.nz> with any suggestions, comments or to say thanks. Log any issues on the [GitHub repository](https://github.com/lukereative/silverstripe-podcast) or feel free to issue a pull request with a fix.
Feel free to email me at <luke@silverstripe.com> with any suggestions, comments or to say thanks. Log any issues on the [GitHub repository](https://github.com/lukereative/silverstripe-podcast) or feel free to issue a pull request with a fix.
9 changes: 9 additions & 0 deletions code/dataobjects/PodcastEpisode.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ public function episodeLink()
return $this->PodcastPage()->AbsoluteLink('episode/' . $this->ID);
}

/**
* Returns the relative link to the episode's page
* @return string
*/
public function relativeEpisodeLink()
{
return $this->PodcastPage()->RelativeLink('episode/' . $this->ID);
}

/**
* Returns a thumbnail of the Episode Image
* @return Image
Expand Down
2 changes: 1 addition & 1 deletion templates/Layout/PodcastPage.ss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% include PodcastRequirements %>
div class="podcast">
<div class="podcast">
<header class="podcast-details">
<% if $PodcastTitle %><h1>$PodcastTitle</h1><% end_if %>
<% if $PodcastImage %><% with PodcastImage.setWidth(200) %><img src="$URL" alt="$Title" class="left"><% end_with %><% end_if %>
Expand Down

0 comments on commit 1f651c2

Please sign in to comment.