This one is a bit strange, I can't figure out what's going on... and I'm still using the old regex parser so it might change with the new one... but the collection in my Wiki page is being generated differently on SSG compared to the live website.
On my dev / live website this only returns places:
But my static website just returns the entire collection:
I tried to get around this by creating a custom Wiki tag to filter the categories myself and I found that sometimes it runs into a TypeError because the category can sometimes be an array and sometimes be a string variable.
/**
* The {{ wiki:category }} tag.
*
* @return string|array
*/
public function category()
{
$category = $this->params->get('category');
// fetch the entries in the collection
return Entry::query()
->where('collection', 'wiki')
->where('published', true)
->get()
->filter(function($item) use ($category) {
$categories = $item->get('category');
$categories = gettype($categories) === "string" ? array($categories) : $categories;
if ($categories) {
return in_array($category, $categories) ? $item : false;
}
});
}
So you can see I had to force the collection category to be an array variable with this line:
Perhaps the static site generator is running into the same error when trying to filter the collections? I'm not sure why the dev/live website is working without a problem though. I don't really understand why it would be different if SSG just visits each webpage to generate it.
This one is a bit strange, I can't figure out what's going on... and I'm still using the old regex parser so it might change with the new one... but the collection in my Wiki page is being generated differently on SSG compared to the live website.
In this example the "category" could be a keyword like
places
orpeople
or a few tags likeplaces + unusual
and my blueprint looks like this:On my dev / live website this only returns places:
But my static website just returns the entire collection:
I tried to get around this by creating a custom
Wiki
tag to filter the categories myself and I found that sometimes it runs into a TypeError because thecategory
can sometimes be an array and sometimes be a string variable.So you can see I had to force the collection
category
to be an array variable with this line:Perhaps the static site generator is running into the same error when trying to filter the collections? I'm not sure why the dev/live website is working without a problem though. I don't really understand why it would be different if SSG just visits each webpage to generate it.