diff --git a/system/src/Grav/Common/Page/Collection.php b/system/src/Grav/Common/Page/Collection.php index 53baf620d..f4b302721 100644 --- a/system/src/Grav/Common/Page/Collection.php +++ b/system/src/Grav/Common/Page/Collection.php @@ -74,6 +74,21 @@ class Collection extends Iterator return new static($this->items, $this->params, $this->pages); } + /** + * + * Merge another collection with the current collection + * + * @param Collection $collection + * @return $this + */ + public function merge(Collection $collection) + { + foreach($collection as $page) { + $this->addPage($page); + } + return $this; + } + /** * Set parameters to the Collection *