Skip to content

Carousel Builder

Thorazine edited this page Jul 24, 2017 · 3 revisions

The carousel builder gets it's values from the Carousel and CarouselImage model. It stores an id of the Carousel model. The relation gets added on page request by a belongsTo relation to the Carousel model.

The Carousel model in turn requires CarouseImage as a relation.

In blade the Carousel Builder should be requested something like this:

@if(@$page->{'the_name_you_gave_the_input'}->carouselImages)
    @foreach($page->{'the_name_you_gave_the_input'}->carouselImages as $carouselImage) 
	<img src="{{ $carouselImage }}" title="{{ $carouselImage->gallery->title }}">
    @endforeach
@endif

As you can see the carouselImage has a relation gallery. Which is the Gallery class, the same as the Image builder. So the options for the image of the carouselImage are those of the Gallery.

Clone this wiki locally