Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
renderer.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
10 ?>
11 <?php $swatchData = $block->getSwatchData(); ?>
12 <div class="swatch-attribute swatch-layered <?= /* @escapeNotVerified */ $swatchData['attribute_code'] ?>"
13  attribute-code="<?= /* @escapeNotVerified */ $swatchData['attribute_code'] ?>"
14  attribute-id="<?= /* @escapeNotVerified */ $swatchData['attribute_id'] ?>">
15  <div class="swatch-attribute-options clearfix">
16  <?php foreach ($swatchData['options'] as $option => $label): ?>
17  <a href="<?= /* @escapeNotVerified */ $label['link'] ?>"
18  aria-label="<?= /* @escapeNotVerified */ $label['label'] ?>"
19  class="swatch-option-link-layered">
20  <?php if (isset($swatchData['swatches'][$option]['type'])) { ?>
21  <?php switch ($swatchData['swatches'][$option]['type']) {
22  case '3':
23  ?>
24  <div class="swatch-option <?= /* @escapeNotVerified */ $label['custom_style'] ?>"
25  tabindex="-1"
26  option-type="3"
27  option-id="<?= /* @escapeNotVerified */ $option ?>"
28  option-label="<?= /* @escapeNotVerified */ $label['label'] ?>"
29  option-tooltip-thumb=""
30  option-tooltip-value=""
31  ></div>
32  <?php break;
33  case '2':
34  ?>
35  <?php $swatchThumbPath = $block->getSwatchPath('swatch_thumb',
36  $swatchData['swatches'][$option]['value']); ?>
37  <?php $swatchImagePath = $block->getSwatchPath('swatch_image',
38  $swatchData['swatches'][$option]['value']); ?>
39  <div class="swatch-option image <?= /* @escapeNotVerified */ $label['custom_style'] ?>"
40  tabindex="-1"
41  option-type="2"
42  option-id="<?= /* @escapeNotVerified */ $option ?>"
43  option-label="<?= /* @escapeNotVerified */ $label['label'] ?>"
44  option-tooltip-thumb="<?= /* @escapeNotVerified */ $swatchThumbPath ?>"
45  option-tooltip-value=""
46  style="background: url(<?= /* @escapeNotVerified */ $swatchImagePath ?>) no-repeat center; background-size: initial;"></div>
47  <?php break;
48  case '1':
49  ?>
50  <div class="swatch-option color <?= /* @escapeNotVerified */ $label['custom_style'] ?>"
51  tabindex="-1"
52  option-type="1"
53  option-id="<?= /* @escapeNotVerified */ $option ?>"
54  option-label="<?= /* @escapeNotVerified */ $label['label'] ?>"
55  option-tooltip-thumb=""
56  option-tooltip-value="<?= /* @escapeNotVerified */ $swatchData['swatches'][$option]['value'] ?>"
57  style="background: <?= /* @escapeNotVerified */ $swatchData['swatches'][$option]['value'] ?> no-repeat center; background-size: initial;"></div>
58  <?php break;
59  case '0':
60  default:
61  ?>
62  <div class="swatch-option text <?= /* @escapeNotVerified */ $label['custom_style'] ?>"
63  tabindex="-1"
64  option-type="0"
65  option-id="<?= /* @escapeNotVerified */ $option ?>"
66  option-label="<?= /* @escapeNotVerified */ $label['label'] ?>"
67  option-tooltip-thumb=""
68  option-tooltip-value=""
69  ><?= /* @escapeNotVerified */ $swatchData['swatches'][$option]['value'] ?></div>
70  <?php break;
71  } ?>
72  <?php } ?>
73  </a>
74  <?php endforeach; ?>
75  </div>
76 </div>
77 
78 <script>
79  require(["jquery", "jquery/ui", "Magento_Swatches/js/swatch-renderer"], function ($) {
80  $('.swatch-layered.<?= /* @escapeNotVerified */ $swatchData['attribute_code'] ?>')
81  .find('[option-type="1"], [option-type="2"], [option-type="0"], [option-type="3"]')
82  .SwatchRendererTooltip();
83  });
84 </script>
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
Definition: block.php:9
endforeach
Definition: renderer.phtml:175
taxRateField find('.mselect-list') .on( 'click.mselect-edit'
Definition: edit.phtml:162
$block
Definition: block.php:8
$label
Definition: details.phtml:21
$swatchData
Definition: renderer.phtml:11