Closed NiklasBuchfink closed 4 years ago
Hey, can you give me a simple codeexample of what you want to achieve?
The documentation of the plugin recommends the following:
If you want an audio player appear on your episode page, just add the follow snippet to your template:
<?php snippet('podcaster-player'); ?>
So I tried to add the snippet to my template with:
{% include '@plugins/podcaster/snippets/podcaster-player.php' %}
Then a part of the php code is printed on the website without errors in the console:
siblings()->find('feed'); switch($podcast->playerType()) { case 'podlove': snippet('podcaster-podlove-player', ['page' => $page, 'podcast' => $podcast]); break; case 'html5': snippet('podcaster-html5-player', ['page' => $page, 'podcast' => $podcast]); break; } ?>
Please try the following:
{% snippet('podcaster-player.php'); %}
When I add the command to my page an Twig\Error\SyntaxError occurs: Unexpected character ";".
And without the ";" : Unknown "snippet" tag.
Sry Niklas, this was my fault, try:
{{ snippet('podcaster-player') }}
Thank you Christian, this works :)
You are welcome. :)
Hey, first of all, high praise for the helpful plugin :) I tried to implement the kirby podcaster plugin (https://github.com/mauricerenck/kirby-podcaster) in a project. For the most part, it works fine, but errors have occurred when using twigs include statement with a PHP snippet. Even with the creation of a new namespace, a successful implementation was not possible.
Is there a better way to access the PHP snippets via Twig? Or is it necessary to re-code this part in the branch?