Browse code

Add image slide lightbox gallery feature

Benjamin Roth authored on23/09/2019 16:13:06
Showing1 changed files
... ...
@@ -23,8 +23,27 @@ class ContentSlickSliderStop extends \ContentElement
23 23
 	 */
24 24
 	protected $strTemplate = 'ce_slick_slider_stop';
25 25
 
26
+  public function generate()
27
+  {
28
+    if (TL_MODE === 'BE') {
29
+      return parent::generate();
30
+    }
26 31
 
27
-	/**
32
+    $parentKey = ($this->arrData['ptable'] ?: 'tl_article') . '__' . $this->arrData['pid'];
33
+
34
+    if (isset($GLOBALS['TL_ESM_SLICK'][$parentKey])) {
35
+      unset($GLOBALS['TL_ESM_SLICK'][$parentKey]);
36
+    }
37
+
38
+    if (!empty($GLOBALS['TL_ESM_SLICK_STACK'][$parentKey])) {
39
+      $GLOBALS['TL_ESM_SLICK'][$parentKey] = array_pop($GLOBALS['TL_ESM_SLICK_STACK'][$parentKey]);
40
+    }
41
+
42
+    return parent::generate();
43
+  }
44
+
45
+
46
+  /**
28 47
 	 * Generate the content element
29 48
 	 */
30 49
 	protected function compile()
Browse code

Initial commit

Benjamin Roth authored on16/02/2017 11:35:38
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,43 @@
1
+<?php
2
+
3
+/**
4
+ * Slick slider for Contao
5
+ *
6
+ * Copyright (c) 2016 Benjamin Roth
7
+ *
8
+ * @license LGPL-3.0+
9
+ */
10
+
11
+namespace eSM_slick;
12
+
13
+
14
+/**
15
+ * Front end content element slick slider start.
16
+ */
17
+class ContentSlickSliderStop extends \ContentElement
18
+{
19
+
20
+	/**
21
+	 * Template
22
+	 * @var string
23
+	 */
24
+	protected $strTemplate = 'ce_slick_slider_stop';
25
+
26
+
27
+	/**
28
+	 * Generate the content element
29
+	 */
30
+	protected function compile()
31
+	{
32
+		if (TL_MODE == 'BE')
33
+		{
34
+			$this->strTemplate = 'be_wildcard';
35
+
36
+			/** @var \BackendTemplate|object $objTemplate */
37
+			$objTemplate = new \BackendTemplate($this->strTemplate);
38
+
39
+			$this->Template = $objTemplate;
40
+			$this->Template->title = $this->headline;
41
+		}
42
+	}
43
+}