Working with Slices

In prismic slices are devided up into repeating and nonrepeating zones and the API works the same way.

Example

In this example, body is the slice field name, and each of those slices have repeating and non repeating sections.

echo Prismic::getByUID('blog_post', 'post-1')
    ->body
    ->first()
    ->nonRepeating
    ->title;

//Echo the repeating section titles

Prismic::getByUID('blog_post', 'post-1')
    ->body
    ->first()
    ->repeating
    ->each(function($document) {
        echo $document->title;
        echo $document->body;
    })

results matching ""

    No results matching ""