Carousel.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <f:comment><!-- Widget flux par Opentalent: Carousel --></f:comment>
  2. <f:comment><!-- Require: https://kenwheeler.github.io/slick/ --></f:comment>
  3. {namespace v=FluidTYPO3\Vhs\ViewHelpers}
  4. {namespace flux=FluidTYPO3\Flux\ViewHelpers}
  5. <div xmlns="http://www.w3.org/1999/xhtml"
  6. xmlns:flux="http://fedext.net/ns/flux/ViewHelpers"
  7. xmlns:v="http://fedext.net/ns/vhs/ViewHelpers"
  8. xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">
  9. <f:layout name="{settings.template}/CustomContent"/>
  10. <f:section name="Configuration">
  11. <flux:form id="Carousel"
  12. label="LLL:EXT:ot_templating/Resources/Private/Language/locallang.xlf:insert_carousel"
  13. description="LLL:EXT:ot_templating/Resources/Private/Language/locallang.xlf:insert_carousel"
  14. extensionName="OtTemplating"
  15. >
  16. <flux:form.option.group value="ot_widgets" />
  17. <flux:form.option.icon value="opentalent-icon-144" />
  18. <flux:field.input name="width" eval="trim" default="600" label="LLL:EXT:ot_templating/Resources/Private/Language/locallang.xlf:width_in_pixels"/>
  19. <flux:field.input name="height" eval="trim" default="400" label="LLL:EXT:ot_templating/Resources/Private/Language/locallang.xlf:height_in_pixels"/>
  20. <flux:field.inline.fal name="images" maxItems="24"/>
  21. </flux:form>
  22. </f:section>
  23. <f:section name="Preview">
  24. <p>Carrousel</p>
  25. <div class="be-carousel-preview">
  26. <f:for each="{v:content.resources.fal(field: 'images', record: '{record}')}"
  27. as="image"
  28. iteration="iterator">
  29. <f:if condition="{v:variable.pregMatch(pattern: '/.*(?:jpe?g|gif|png)$/', subject: image.url)}">
  30. <f:image treatIdAsReference="1"
  31. src="{image.id}"
  32. title="{image.title}"
  33. alt="{image.alternative}"
  34. class="be-carousel-img-preview"
  35. maxWidth="128"
  36. maxHeight="128"
  37. />
  38. </f:if>
  39. </f:for>
  40. </div>
  41. </f:section>
  42. <f:section name="Main">
  43. <div class="center-carousel">
  44. <div class="carousel" style="max-width:{width}px; max-height:{height}px;">
  45. <f:for each="{v:content.resources.fal(field: 'images', record: '{record}')}"
  46. as="image"
  47. iteration="iterator">
  48. <div style="display: flex;flex-direction: row;justify-content: center;align-items: center;height:100%;width:{width}px;height:{height}px;">
  49. <f:image treatIdAsReference="1"
  50. src="{image.id}"
  51. title="{image.title}"
  52. alt="{image.alternative}"
  53. class="carousel-img"
  54. height="{height}"
  55. style="max-width:{width}px;max-height:{height}px;width:auto;height:auto;"
  56. />
  57. </div>
  58. </f:for>
  59. </div>
  60. </div>
  61. </f:section>
  62. </div>