Pau*_*ane 7 categories magento2
我正在尝试找出如何用竖线(|)分隔限制器值的方法
理想情况下,最终结果将是:View | 48 | 120 | 全部,目前我已经能够查看:48 120 ALL
这是我到目前为止使用的:
<div class="field limiter">
<label class="label" for="limiter">
<span><?= /* @escapeNotVerified */ __('View:') ?></span>
</label>
<div class="control">
<?php foreach ($block->getAvailableLimit() as $_key => $_limit): ?>
<a data-role="limiter" href="#" data-value="<?php /* @escapeNotVerified */ echo $_key ?>"<?php if ($block->isLimitCurrent($_key)): ?>
class="selected"<?php endif ?>>
<?php /* @escapeNotVerified */ echo $_limit ?>
</a>
<?php endforeach; ?>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
小智 2
通过 CSS 可以轻松完成。
我总是更喜欢使用 CSS 进行此类调整。
.limiter .control a + a::before {
content: " | ";
}
Run Code Online (Sandbox Code Playgroud)
它将在标签之间添加管道分隔符
希望以上能有所帮助!