From 9a780ddda7323339914e2156775e0ae49d2a5583 Mon Sep 17 00:00:00 2001 From: Matthew Dirks Date: Thu, 20 Jun 2024 09:56:38 -0700 Subject: [PATCH 1/3] Clarified description of `asset_id` Previous description was vague. Previous description makes it sound like a globally-unique ID (such as primary key `id`), which it isn't. The asset_id refers to `episode_asset_id` column of table `wp_podlove_mediafile` (and not the `id` column) --- publisher/api.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/publisher/api.json b/publisher/api.json index 0496b081..3e05aa23 100644 --- a/publisher/api.json +++ b/publisher/api.json @@ -6954,7 +6954,7 @@ "AssetId": { "name": "asset_id", "in": "path", - "description": "Unique identifier for the asset.", + "description": "Unique identifier for the asset. Each asset in an episode's set of assets has an ID starting from 1 (e.g., the first asset has asset_id=1, the second asset has asset_id=2, and so on).", "required": true, "schema": { "type": "string" @@ -6962,4 +6962,4 @@ } } } -} \ No newline at end of file +} From dc71d07e8b1ee88723a05ba310a309f0759ec672 Mon Sep 17 00:00:00 2001 From: Matthew Dirks Date: Thu, 20 Jun 2024 10:11:38 -0700 Subject: [PATCH 2/3] Updated links (changed sensiolabs.org to symfony.con) --- publisher/guides/templates.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/publisher/guides/templates.mdx b/publisher/guides/templates.mdx index fc5e6dd0..d90a5add 100644 --- a/publisher/guides/templates.mdx +++ b/publisher/guides/templates.mdx @@ -254,7 +254,7 @@ echo get_podcast()->title(); ?> ``` -[1]: http://twig.sensiolabs.org/ -[2]: http://twig.sensiolabs.org/doc/templates.html +[1]: https://twig.symfony.com/ +[2]: https://twig.symfony.com/doc/3.x/templates.html [3]: /podlove-publisher/reference/templates/template-tags/podcast -[4]: http://twig.sensiolabs.org/doc/tags/macro.html +[4]: https://twig.symfony.com/doc/3.x/tags/macro.html From 9f7eabb2bd3af10b7b4c3be08c010dac3740a3e3 Mon Sep 17 00:00:00 2001 From: Matthew Dirks Date: Thu, 20 Jun 2024 10:25:09 -0700 Subject: [PATCH 3/3] Added twig example of filtering to select episodes from a given year --- publisher/guides/templates.mdx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/publisher/guides/templates.mdx b/publisher/guides/templates.mdx index d90a5add..01d464e7 100644 --- a/publisher/guides/templates.mdx +++ b/publisher/guides/templates.mdx @@ -133,6 +133,24 @@ To use them in another template, you need to import the macros before using them {% endraw %} ``` +### Filters + +Twig filters can be used to filter the list of episodes. For example, this filter selects only the episodes from the year 2024: + +```handlebars +{% set filtered_episodes = podcast.episodes|filter(episode => episode.publicationDate.format('Y') == "2024") %} + + +``` + ## Creating PHP Templates — For Theme Developers _Available from Podlove Publisher version 2.3_