Carousel.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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="{f:translate(key: 'insert_carousel')}"
  13. description="{f:translate(key: 'insert_carousel')}"
  14. extensionName="OtTemplating"
  15. >
  16. <flux:form.option.group value="ot_widgets" />
  17. <flux:form.option.icon value="EXT:ot_templating/Resources/Public/Icons/opentalent-144x144.png" />
  18. <flux:field.input name="width" eval="trim" default="600" label="{f:translate(key: 'width_in_pixels')}"/>
  19. <flux:field.input name="height" eval="trim" default="400" label="{f:translate(key: 'height_in_pixels')}"/>
  20. <flux:field.checkbox name="crop" label="{f:translate(key: 'crop_large_images')} ?" default="0"/>
  21. <flux:field.inline.fal name="images" minItems="2" maxItems="24"/>
  22. </flux:form>
  23. </f:section>
  24. <f:section name="Preview">
  25. <p>Carrousel</p>
  26. <div class="be-carousel-preview">
  27. <f:for each="{v:content.resources.fal(field: 'images', record: '{record}')}"
  28. as="image"
  29. iteration="iterator">
  30. <f:if condition="{v:variable.pregMatch(pattern: '/.*(?:jpe?g|gif|png)$/', subject: image.url)}">
  31. <f:image treatIdAsReference="1"
  32. src="{image.id}"
  33. title="{image.title}"
  34. alt="{image.alternative}"
  35. class="be-carousel-img-preview"
  36. maxWidth="128"
  37. maxHeight="128"
  38. />
  39. </f:if>
  40. </f:for>
  41. </div>
  42. </f:section>
  43. <f:section name="Main">
  44. <div class="center-carousel">
  45. <div class="carousel" style="max-width:{width}px; max-height:{height}px">
  46. <f:for each="{v:content.resources.fal(field: 'images', record: '{record}')}"
  47. as="image"
  48. iteration="iterator">
  49. <div style="height: {height}px">
  50. <f:image treatIdAsReference="1"
  51. src="{image.id}"
  52. title="{image.title}"
  53. alt="{image.alternative}"
  54. class="carousel-img"
  55. width="{width}"
  56. maxHeight="{height}{f:if(condition: crop, then: 'c')}"
  57. />
  58. </div>
  59. </f:for>
  60. </div>
  61. </div>
  62. </f:section>
  63. </div>