children in modular subpage
I have childrens in modular subpage and I suggest this change:
row 173
$parent = $this->getModularParent($cpage, $cpage); if ($parent) $extras[$parent->path()] = ['slug' => $parent->slug()];
instead of:
if ($cpage->modular()) { $this->collection->remove($cpage); $parent = $cpage->parent(); $extras[$parent->path()] = ['slug' => $parent->slug()]; }
I create this function:
protected function getModularParent($cpage, $leafPage) { $parent = null; if ($cpage->modular()) { $this->collection->remove($leafPage); $parent = $cpage->parent(); } elseif ($cpage->parent()) { $parent = $this->getModularParent($cpage->parent(), $cpage); } return $parent; }
How about a pull request with this proposed change so we can test it? Thanks!
It's super easy, simply browse to the source file in GitHub and click edit.. This will automatically fork the project and create a pull request. Or read the docs: https://help.github.com/articles/creating-a-pull-request/
I tried to do it, but I'm not sure if I have created a pull request (see https://github.com/masetto/grav-plugin-simplesearch).
You created a PR for your own repository https://github.com/masetto/grav-plugin-simplesearch/pulls, not for this repo.
Check https://help.github.com/articles/creating-a-pull-request-from-a-fork/ on how to submit the PR
Finally, I did it! Right?