Skip to content

Commit

Permalink
TASK: Update rendering and document
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsunet committed Mar 20, 2017
1 parent 02293b6 commit de0b9d1
Show file tree
Hide file tree
Showing 16 changed files with 259 additions and 338 deletions.
135 changes: 0 additions & 135 deletions Classes/Fusion/RawCollectionImplementation.php

This file was deleted.

10 changes: 5 additions & 5 deletions Configuration/NodeTypes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
image:
type: Neos\Media\Domain\Model\ImageInterface
ui:
label: i18n
label: Podcast Image
reloadIfChanged: true
inspector:
group: document
Expand Down Expand Up @@ -65,19 +65,19 @@
ui:
inspector:
group: document
label: i18n
label: Audio Length
poster:
type: Neos\Media\Domain\Model\ImageInterface
ui:
label: i18n
label: Episode Image
reloadIfChanged: true
inspector:
group: document
position: 50
publicationDate:
type: DateTime
ui:
label: i18n
label: Publication Date
reloadIfChanged: true
inspector:
group: document
Expand Down Expand Up @@ -158,4 +158,4 @@
superTypes:
'Neos.Neos:Content': true
ui:
label: 'Episode List'
label: Episode List
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,70 @@ Podcasting Plugin for Neos
==========================

Provides podcasting functionality for Neos and integrates the [Podlove Web Player](http://podlove.org/podlove-web-player/).


Installation
------------

`composer require dasperfekteteam/podcaster`

This plugin requires Neos from 3.0 upwards.

The player needs jQuery and the provided JavaScript to work.
For ease of use a Fusion snippet is available to include these:

`page.head.podcaster = DasPerfekteTeam.Podcaster:PageHeaderIncludes`

By default this will not load jQuery and expects an existing, loaded jQuery.
You can enable loading of jQuery like this:

page.head.podcaster = DasPerfekteTeam.Podcaster:PageHeaderIncludes {
loadJQuery = true
}

Quickstart
----------

This package provides two page types:

#### Podcast ####

This is the home of a new podcast (eg. a set of episodes with the same topic).
Many websites will have a single podcast, but functionality is provided to have multiple podcasts in one Neos Site.

All meta data for the podcast is derived from this page and it's also the entry point for the podcast feed.

#### Episode ####

This is the page for a single episode for the podcast. It holds all metadata for the episode and can contain
additional information about it. In backend it will render an additional content area for `Chapters` which
will create the chapter list for the web player.

You can upload your episode in multiple audio formats which defines which kind of feeds you can access.


### Feeds ###

The main feature is generation of RSS feeds for podcasts. A default route is enabled with installation of this package,
which can produce feeds for any `Podcast` and audio format on your site.

The easiest is, if your `Podcast` page is the homepage of your site, then the URL for a feed is:

`http://domain/podcast.{audioformat}.xml` eg. `https://www.das-perfekte-team.de/podcast.mp3.xml`

If your `Podcast` starts on a sub page, the URL would be:

`http://domain/path/to/your/page.podcast.{audioformat}.xml`

The `audioformat` is always the file extension of your episodes files,
so if you provide your podcast as `mp3`, `ogg` and `m4a` these three have their own feed.

Feed rendering can be customized by Fusion and Template changes.


### To be continued ###

More features and documentation should follow at a later stage.
More integrations to services and Neos is planned for the future.


52 changes: 52 additions & 0 deletions Resources/Private/Fusion/Feed/Channel.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Rendering of the outer (channel) feed XML for the podcast
*/
prototype(DasPerfekteTeam.Podcaster:Feed) < prototype(Neos.Fusion:Template) {
@context.podcast = ${q(node).closest('[instanceof DasPerfekteTeam.Podcaster:Podcast]').get(0)}
templatePath = 'resource://DasPerfekteTeam.Podcaster/Private/Templates/Feed/Channel.xml'

podcast = ${podcast}
title = ${q(podcast).property('title')}
url = Neos.Neos:NodeUri {
node = ${podcast}
format = 'html'
absolute = true
}

selfLink = ${request.httpRequest.uri}

description = ${q(podcast).property('metaDescription')}
date = ${Date.format('now', 'D, d M Y H:i:s O')}
image = Neos.Neos:ImageUri {
asset = ${q(podcast).property('image')}
absolute = true
}
author = ${q(podcast).property('author')}
explicit = ${q(podcast).property('explicit') ? 'yes' : 'no'}
category = ''
email = ''

keywords = ${q(podcast).property('metaKeywords')}
summary = ${q(podcast).property('summary') ? q(podcast).property('summary') : q(podcast).property('metaDescription')}
locale = 'de-DE'

episodes = ${q(podcast).children('[instanceof DasPerfekteTeam.Podcaster:Episode]')}
episodeRenderer = DasPerfekteTeam.Podcaster:Feed.Episode


@cache {
mode = 'cached'

entryIdentifier {
node = ${node}
audiotype = ${request.arguments.audiotype}
}

entryTags {
# Whenever the node changes the matched condition could change
1 = ${'Node_' + documentNode.identifier}
# Whenever an episode changes
3 = 'NodeType_DasPerfekteTeam.Podcaster:Episode'
}
}
}
27 changes: 27 additions & 0 deletions Resources/Private/Fusion/Feed/Episode.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Rendering definition for the XML snippet of a single episode in the Podcast feed
*/
prototype(DasPerfekteTeam.Podcaster:Feed.Episode) < prototype(Neos.Fusion:Template) {
templatePath = 'resource://DasPerfekteTeam.Podcaster/Private/Templates/Feed/Episode.xml'

episode = ${episode}
title = ${q(episode).property('title')}
subtitle = ${q(episode).property('titleOverride')}
url = Neos.Neos:NodeUri {
node = ${episode}
format = 'html'
absolute = true
}
description = ${q(episode).property('metaDescription')}
date = ${Date.format(q(episode).property('publicationDate'), 'D, d M Y H:i:s O')}
image = Neos.Neos:ImageUri {
asset = ${q(episode).property('poster')}
absolute = true
@if.hasImage = ${q(documentNode).property('poster') != null}
}

audio = ${Array.first(Podcaster.filterByProperty(q(episode).property('audio'), 'resource.fileExtension', request.arguments.audiotype))}
audioLength = ${q(episode).property('audioLength')}

@if.hasAudio = ${this.audio ? true : false}
}
18 changes: 18 additions & 0 deletions Resources/Private/Fusion/Feed/Root.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* The HTTP message for the podcast XML feed
*/
prototype(DasPerfekteTeam.Podcaster:Feed.Http) < prototype(Neos.Fusion:Http.Message) {
httpResponseHead.headers.Content-Type = 'application/xml'
content = DasPerfekteTeam.Podcaster:Feed
}

root {
podcastFeed {
condition = ${request.format == 'podcast.xml'}
renderer = DasPerfekteTeam.Podcaster:Feed.Http
}

@cache.entryIdentifier {
audiotype = ${request.arguments.audiotype}
}
}
15 changes: 15 additions & 0 deletions Resources/Private/Fusion/FusionObjects/EpisodeCard.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
prototype(DasPerfekteTeam.Podcaster:EpisodeCard) < prototype(Neos.Fusion:Template) {
templatePath = 'resource://DasPerfekteTeam.Podcaster/Private/Templates/FusionObjects/EpisodeCard.html'
node = ${item}
title = ${item.label}
player = DasPerfekteTeam.Podcaster:PlayerEmbed {
@context.episodeNode = ${item}

metadata {
summaryVisible = false
timecontrolsVisible = false
sharebuttonsVisible = false
chaptersVisible = false
}
}
}
15 changes: 15 additions & 0 deletions Resources/Private/Fusion/NodeTypes/EpisodeList.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
prototype(DasPerfekteTeam.Podcaster:EpisodeList) >
prototype(DasPerfekteTeam.Podcaster:EpisodeList) < prototype(Neos.Fusion:Tag) {
tagName = 'div'
attributes.class = 'row'
content = Neos.Fusion:Collection {
collection = ${q(site).find('[instanceof DasPerfekteTeam.Podcaster:Episode]')}
itemRenderer = DasPerfekteTeam.Podcaster:EpisodeCard
}

# The following line must not be removed as it adds required meta data to all content elements in backend
@process.contentElementWrapping {
expression = Neos.Neos:ContentElementWrapping
@position = 'end 999999999'
}
}
Loading

0 comments on commit de0b9d1

Please sign in to comment.