d4l-data4life / kirby3-static-site-generator

Static site generator plugin for Kirby 3+. With this plugin you can create a directory with assets, media and static html files generated from your pages. The result is an even faster site with less potential vulnerabilities.
MIT License
134 stars 8 forks source link

Gallery Example; $page->story()->toBlocks() #75

Closed Anjade closed 1 year ago

Anjade commented 1 year ago

Today I tried to use the examples for a gallery. Instead of having subpages, I use the images plus some fields to show a virtual page. The static machinery produces this virtual pages as static pages, but they don't use the statement:

$page->story()->toBlocks()

https://getkirby.com/docs/cookbook/templating/virtual-pages-image-gallery

Here are a part from the template gallery-image.php

<?= $page->photographer()->html() ?> <?= $page->story()->toBlocks() ?>

The page is build, the photographer shown; but not the field story! Kirby dynamical shows the story, static pages don't show the story.

Please remember that $pages and toBlocks works well. But files plus a field toBlocks seems not to work.

Try the example, please.

Anjade commented 1 year ago

I don't know what to do more. The virtual pages from the Gallery Example are built. But there is now only the filename and the picture, I can see. Two days ago, I had all fields shown also, but not the blockField.

Can you please check the Gallery example, if you can see normal fields and a blockField on the virtual page for a picture?

Anjade commented 1 year ago

Ok; i have solved it:

When i use <?= $page->story()->toBlocks() ?>

then I see my content in dynamic Kirby, but not in the static page.

When I do this: <?php $image = $page->image(); ?> <?= $image->story()->toBlocks() ?>

or

<?= $page->image()->story()->toBlocks() ?>

then it works.

Kirby dynamic adds $image->something to $page->something; but when building static pages, this is not happening.

Anjade commented 1 year ago

But! There are still problems:

Some other addons wants to have $page; but the infos are now in $page->image->

The breadcrump is broken, also the SEO-Knights-plugin;

can you please check the code and find out, why Kirby dynamic has all infos from $image also in $page, but the static plugin hasn't this?

jonathan-reisdorf commented 1 year ago

We can unfortunately not provide support for individual Kirby installations. We'd need a reproducible and easily followable bug description where it's clear that the bug is caused by the static site generator plugin and nothing else. This looks like an incompatibility with another plugin. Only one plugin can override kirby's built-in file::version and file::url components, so if the respective plugins need access to the same components there's nothing we could fix.