src/extensions/PageSlicesExtension.php
public function onAfterDuplicate(\Page $page)
    {
        foreach ($this->owner->PageSlices() as $slice) {
            /** @var PageSlice $slice */
            $sliceCopy = $slice->duplicate(true);
            $page->PageSlices()->add($sliceCopy);
            $sliceCopy->publishRecursive();
        }
    }
public function onAfterDuplicate(\Page $page)
    {
        foreach ($this->owner->PageSlices() as $slice) {
            /** @var PageSlice $slice */
            $sliceCopy = $slice->duplicate(true);
            $page->PageSlices()->add($sliceCopy);
            $sliceCopy->publishRecursive();
        }
    }
public function onAfterDuplicate ( \ Page $ page ) { foreach ( $ this -> owner -> PageSlices ( ) as $ slice ) { /** @var PageSlice $slice */ $ sliceCopy = $ slice -> duplicate ( true ) ; $ page -> PageSlices ( ) -> add ( $ sliceCopy ) ; $ sliceCopy -> publishRecursive ( ) ; } }
Loop over and copy the attached page slices

@param \Page $page
Loop over and copy the attached page slices