Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
links.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <?php /* @var $block \Magento\Downloadable\Block\Catalog\Product\Links */ ?>
11 <?php $_linksPurchasedSeparately = $block->getLinksPurchasedSeparately(); ?>
12 <?php if ($block->getProduct()->isSaleable() && $block->hasLinks()):?>
13  <?php $_links = $block->getLinks(); ?>
14  <?php $_linksLength = 0; ?>
15  <?php $_isRequired = $block->getLinkSelectionRequired(); ?>
16  <legend class="legend links-title"><span><?= $block->escapeHtml($block->getLinksTitle()) ?></span></legend><br>
17  <div class="field downloads<?php if ($_isRequired) echo ' required' ?><?php if (!$_linksPurchasedSeparately) echo ' downloads-no-separately' ?>">
18  <label class="label"><span><?= $block->escapeHtml($block->getLinksTitle()) ?></span></label>
19  <div class="control" id="downloadable-links-list"
20  data-mage-init='{"downloadable":{
21  "linkElement":"input:checkbox[value]",
22  "allElements":"#links_all",
23  "config":<?= /* @escapeNotVerified */ $block->getJsonConfig() ?>}
24  }'
25  data-container-for="downloadable-links">
26  <?php foreach ($_links as $_link): ?>
27  <?php $_linksLength++;?>
28  <div class="field choice" data-role="link">
30  <input type="checkbox"
31  <?php if ($_isRequired): ?>data-validate="{'validate-one-checkbox-required-by-name':'downloadable-links-list'}" <?php endif; ?>
32  name="links[]"
33  id="links_<?= /* @escapeNotVerified */ $_link->getId() ?>"
34  value="<?= /* @escapeNotVerified */ $_link->getId() ?>" <?= /* @escapeNotVerified */ $block->getLinkCheckedValue($_link) ?> />
35  <?php endif; ?>
36  <label class="label" for="links_<?= /* @escapeNotVerified */ $_link->getId() ?>">
37  <span><?= $block->escapeHtml($_link->getTitle()) ?></span>
38  <?php if ($_link->getSampleFile() || $_link->getSampleUrl()): ?>
39  <a class="sample link"
40  href="<?= $block->escapeUrl($block->getLinkSampleUrl($_link)) ?>" <?= $block->getIsOpenInNewWindow() ? 'target="_blank"' : '' ?>>
41  <?= /* @escapeNotVerified */ __('sample') ?>
42  </a>
43  <?php endif; ?>
44  <?php if ($_linksPurchasedSeparately): ?>
45  <?= /* @escapeNotVerified */ $block->getLinkPrice($_link) ?>
46  <?php endif; ?>
47  </label>
48  </div>
49  <?php endforeach; ?>
50  <?php if ($_linksPurchasedSeparately && $_linksLength > 1): ?>
51  <div class="field choice downloads-all">
52  <input type="checkbox"
53  data-notchecked="<?= /* @escapeNotVerified */ __('Select all') ?>"
54  data-checked="<?= /* @escapeNotVerified */ __('Unselect all') ?>"
55  id="links_all" />
56  <label class="label" for="links_all"><span><?= /* @escapeNotVerified */ __('Select all') ?></span></label>
57  </div>
58  <?php endif; ?>
59  </div>
60  <?php if ($_isRequired): ?>
61  <span id="links-advice-container"></span>
62  <?php endif;?>
63  </div>
64 <?php endif; ?>
$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
if( $form)() ?>< script > require(['jquery' mage mage
Definition: save.phtml:15
__()
Definition: __.php:13
$block
Definition: block.php:8