Regarding the modular/blog in antimatter (and grav in general), is my understanding correct that one could tweak the antimatter blog.html.twig
so that it renders content that, at file level, is structured like the content of a modular page?
Is there some code magic inside /system/src to make modular work?
I see that simplesearch finds words inside a text.md
(a modular module) if that has the correct taxonomy and gives a link into the _module
directory in the search results page. However when clicking that link I get a 404. This would prevent searching in a modular blog.
Could a plugin intercept such a 404 and from that path figure out what was the blog that should have been shown?
It seems I can have module inside a module (grav does not fail on this structure). simplesearch is finding this sub module of the modular page, showing it in the search result page but like before clicking the search link results in 404.
I see that a module inside a module is not rendered by the modular.md (e.g it renders 01.mymodular/_part1/text.md
but not 01.mymodular/_part1/_part1.1 /text.md
). That’s on purpose?
Reason for asking I was thinking of plugin MultiParts that could, or render the whole modular, or part/chapter by part/chapter. At the top and bottom there could be a little menu to navigate to other parts/chapters.
If the plugin is not active, grav would by default render the modular as a single long page consisting of all its modules.
The use cases I was thinking about are smallish ebook, a large paper (with several chapters), a number of follow up blogs, a holiday dairy, each module directory holds another holiday with pictures, …
The main issue with your idea is that modular pages are not routable. Ie, they are only parts of a single page, and that page is processed and built when the parent page’s content()
is requested. Those individular modular pages, are not accessible by themselves, you cannot reach them individually via a URL (hence the 404 in simplesearch).
Regarding simplesearch, sounds like there’s a bug there. It should not search in non-routable/modular pages.
Thank you rhukster for the explanation. If I don’t put the taxonomy:category
, it will never be part of search results.
But in some way I feel like simplesearch should be able to search in a modular page, including its parts (putting the taxonomy header in the modular page is not enough to get in a successful match).
So that also answers in what way modular pages are handled by Grav internally :-).
I think it should link to the parent though if it finds a result in a modular page, that would be expected.