-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component - Carousel #100
Comments
Update with PR #102 everything works as expected. (ignore the missing slide as it is just a test for raw html content) |
Sorry for ghosting your request, it is large and I don't need it yet ... so I tried to hide 😬 In general I love the idea of every pre-made component which we can simply re-use. I will have to test it in the demo app for real feedback, I am not good in theoretical code discussions. |
No the What I wanted (what I am currently also using in my project) is an array like: {% set items = [] %}
{% for i in 0..4 %}
{% set items = items | merge({(loop.index): {'image' : 'https://via.placeholder.com/640x360/1454bc/ffffff?text=Image+' ~ loop.index}}) %}
{% endfor %} a more "real life" example: // Controller
/**
* @param Product $product
* @param string $language
*
* @return Response
* @throws InvalidArgumentException
* @throws UnknownProperties
* @Entity("product", expr="repository.find(id)")
*/
public function showGallery(Product $product, string $language): Response
{
$templateVars = [];
$images = $this->productViewerCreatorImageService->getProductImages($product, $language);
if(!empty($images)){
$templateVars['images'] = [];
foreach ($images as $index => $image) {
$templateVars['images'][] = [
'image' => $image->large_square,
];
}
}
return $this->render('partials/product_viewer/components/_image_gallery.html.twig', $templateVars);
} // _image_gallery.html.twig
<div class="product image-gallery">
{% from 'macro/carousel.html.twig' import carousel %}
{% set options =
{
'interval': 5000,
'controls': false,
'indicators': true,
'indicators_type': 'thumbs',
'indicators_orientation': 'horizontal',
} %}
{{ carousel(images, options) }}
</div> // some other template using this gallery
<div class="images col-lg-6 order-md-1 order-2">
{{ render(controller(
'App\\Controller\\ProductViewer\\ProductViewerImageController::showGallery',
{ id: product.id, language: language }
)) }}
</div> |
Dear All
Again a new component. Please provide some feedback before I create a PR + Docs.
I have tried to cover most of BS5 configuration options. The latest tabler options with
dots
,thumbs
andvertical
are included but not available as we are not on the latest version (https://preview.tabler.io/changelog.html).Remarks:
Usage:
The text was updated successfully, but these errors were encountered: