separate limiter values with a pipe (|)












3















I am trying to work out how I can separate my limiter values with a pipe (|)



Ideally, the end result will be View: 48 | 120 | ALL, at present I have been able to get View: 48 120 ALL



This is what I have used so far:



<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>









share|improve this question





























    3















    I am trying to work out how I can separate my limiter values with a pipe (|)



    Ideally, the end result will be View: 48 | 120 | ALL, at present I have been able to get View: 48 120 ALL



    This is what I have used so far:



    <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>









    share|improve this question



























      3












      3








      3








      I am trying to work out how I can separate my limiter values with a pipe (|)



      Ideally, the end result will be View: 48 | 120 | ALL, at present I have been able to get View: 48 120 ALL



      This is what I have used so far:



      <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>









      share|improve this question
















      I am trying to work out how I can separate my limiter values with a pipe (|)



      Ideally, the end result will be View: 48 | 120 | ALL, at present I have been able to get View: 48 120 ALL



      This is what I have used so far:



      <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>






      magento2 category






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 13 hours ago









      magefms

      1,673425




      1,673425










      asked 14 hours ago









      Paul 'Whippet' McGuanePaul 'Whippet' McGuane

      1445




      1445






















          2 Answers
          2






          active

          oldest

          votes


















          1














          It can be easily done by CSS.



          I always prefer CSS for this kind of tweaks.



          .limiter .control a + a::before {
          content: " | ";
          }


          It will Add a Pipe separator between a tag



          Demo can be found at Fiddle



          Hope above will help!






          share|improve this answer
























          • didn't even come to my mind to use less, ive made a slight change on the above but have achieved the desired result

            – Paul 'Whippet' McGuane
            13 hours ago











          • @Paul'Whippet'McGuane, Glad to know :)

            – Pawan
            13 hours ago











          • causes a slight styling issue but I am hopefully I can fix that

            – Paul 'Whippet' McGuane
            13 hours ago






          • 1





            Yes, you can add more class in hierarchy to avoid issue.

            – Pawan
            13 hours ago











          • already solved with some additional attributes added. perfect solution

            – Paul 'Whippet' McGuane
            13 hours ago



















          0














          Try using PHP implode(), check below modified code:



          <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 implode("|",$_limit) ?>
          </a>
          <?php endforeach; ?>
          </div>
          </div>





          share|improve this answer
























          • it does not like, gave me a screen full of errors :(

            – Paul 'Whippet' McGuane
            13 hours ago











          • how about removing implode echo "|",$_limit ? have you tried

            – magefms
            13 hours ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266205%2fseparate-limiter-values-with-a-pipe%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          It can be easily done by CSS.



          I always prefer CSS for this kind of tweaks.



          .limiter .control a + a::before {
          content: " | ";
          }


          It will Add a Pipe separator between a tag



          Demo can be found at Fiddle



          Hope above will help!






          share|improve this answer
























          • didn't even come to my mind to use less, ive made a slight change on the above but have achieved the desired result

            – Paul 'Whippet' McGuane
            13 hours ago











          • @Paul'Whippet'McGuane, Glad to know :)

            – Pawan
            13 hours ago











          • causes a slight styling issue but I am hopefully I can fix that

            – Paul 'Whippet' McGuane
            13 hours ago






          • 1





            Yes, you can add more class in hierarchy to avoid issue.

            – Pawan
            13 hours ago











          • already solved with some additional attributes added. perfect solution

            – Paul 'Whippet' McGuane
            13 hours ago
















          1














          It can be easily done by CSS.



          I always prefer CSS for this kind of tweaks.



          .limiter .control a + a::before {
          content: " | ";
          }


          It will Add a Pipe separator between a tag



          Demo can be found at Fiddle



          Hope above will help!






          share|improve this answer
























          • didn't even come to my mind to use less, ive made a slight change on the above but have achieved the desired result

            – Paul 'Whippet' McGuane
            13 hours ago











          • @Paul'Whippet'McGuane, Glad to know :)

            – Pawan
            13 hours ago











          • causes a slight styling issue but I am hopefully I can fix that

            – Paul 'Whippet' McGuane
            13 hours ago






          • 1





            Yes, you can add more class in hierarchy to avoid issue.

            – Pawan
            13 hours ago











          • already solved with some additional attributes added. perfect solution

            – Paul 'Whippet' McGuane
            13 hours ago














          1












          1








          1







          It can be easily done by CSS.



          I always prefer CSS for this kind of tweaks.



          .limiter .control a + a::before {
          content: " | ";
          }


          It will Add a Pipe separator between a tag



          Demo can be found at Fiddle



          Hope above will help!






          share|improve this answer













          It can be easily done by CSS.



          I always prefer CSS for this kind of tweaks.



          .limiter .control a + a::before {
          content: " | ";
          }


          It will Add a Pipe separator between a tag



          Demo can be found at Fiddle



          Hope above will help!







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 13 hours ago









          PawanPawan

          1,8992617




          1,8992617













          • didn't even come to my mind to use less, ive made a slight change on the above but have achieved the desired result

            – Paul 'Whippet' McGuane
            13 hours ago











          • @Paul'Whippet'McGuane, Glad to know :)

            – Pawan
            13 hours ago











          • causes a slight styling issue but I am hopefully I can fix that

            – Paul 'Whippet' McGuane
            13 hours ago






          • 1





            Yes, you can add more class in hierarchy to avoid issue.

            – Pawan
            13 hours ago











          • already solved with some additional attributes added. perfect solution

            – Paul 'Whippet' McGuane
            13 hours ago



















          • didn't even come to my mind to use less, ive made a slight change on the above but have achieved the desired result

            – Paul 'Whippet' McGuane
            13 hours ago











          • @Paul'Whippet'McGuane, Glad to know :)

            – Pawan
            13 hours ago











          • causes a slight styling issue but I am hopefully I can fix that

            – Paul 'Whippet' McGuane
            13 hours ago






          • 1





            Yes, you can add more class in hierarchy to avoid issue.

            – Pawan
            13 hours ago











          • already solved with some additional attributes added. perfect solution

            – Paul 'Whippet' McGuane
            13 hours ago

















          didn't even come to my mind to use less, ive made a slight change on the above but have achieved the desired result

          – Paul 'Whippet' McGuane
          13 hours ago





          didn't even come to my mind to use less, ive made a slight change on the above but have achieved the desired result

          – Paul 'Whippet' McGuane
          13 hours ago













          @Paul'Whippet'McGuane, Glad to know :)

          – Pawan
          13 hours ago





          @Paul'Whippet'McGuane, Glad to know :)

          – Pawan
          13 hours ago













          causes a slight styling issue but I am hopefully I can fix that

          – Paul 'Whippet' McGuane
          13 hours ago





          causes a slight styling issue but I am hopefully I can fix that

          – Paul 'Whippet' McGuane
          13 hours ago




          1




          1





          Yes, you can add more class in hierarchy to avoid issue.

          – Pawan
          13 hours ago





          Yes, you can add more class in hierarchy to avoid issue.

          – Pawan
          13 hours ago













          already solved with some additional attributes added. perfect solution

          – Paul 'Whippet' McGuane
          13 hours ago





          already solved with some additional attributes added. perfect solution

          – Paul 'Whippet' McGuane
          13 hours ago













          0














          Try using PHP implode(), check below modified code:



          <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 implode("|",$_limit) ?>
          </a>
          <?php endforeach; ?>
          </div>
          </div>





          share|improve this answer
























          • it does not like, gave me a screen full of errors :(

            – Paul 'Whippet' McGuane
            13 hours ago











          • how about removing implode echo "|",$_limit ? have you tried

            – magefms
            13 hours ago
















          0














          Try using PHP implode(), check below modified code:



          <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 implode("|",$_limit) ?>
          </a>
          <?php endforeach; ?>
          </div>
          </div>





          share|improve this answer
























          • it does not like, gave me a screen full of errors :(

            – Paul 'Whippet' McGuane
            13 hours ago











          • how about removing implode echo "|",$_limit ? have you tried

            – magefms
            13 hours ago














          0












          0








          0







          Try using PHP implode(), check below modified code:



          <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 implode("|",$_limit) ?>
          </a>
          <?php endforeach; ?>
          </div>
          </div>





          share|improve this answer













          Try using PHP implode(), check below modified code:



          <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 implode("|",$_limit) ?>
          </a>
          <?php endforeach; ?>
          </div>
          </div>






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 13 hours ago









          magefmsmagefms

          1,673425




          1,673425













          • it does not like, gave me a screen full of errors :(

            – Paul 'Whippet' McGuane
            13 hours ago











          • how about removing implode echo "|",$_limit ? have you tried

            – magefms
            13 hours ago



















          • it does not like, gave me a screen full of errors :(

            – Paul 'Whippet' McGuane
            13 hours ago











          • how about removing implode echo "|",$_limit ? have you tried

            – magefms
            13 hours ago

















          it does not like, gave me a screen full of errors :(

          – Paul 'Whippet' McGuane
          13 hours ago





          it does not like, gave me a screen full of errors :(

          – Paul 'Whippet' McGuane
          13 hours ago













          how about removing implode echo "|",$_limit ? have you tried

          – magefms
          13 hours ago





          how about removing implode echo "|",$_limit ? have you tried

          – magefms
          13 hours ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266205%2fseparate-limiter-values-with-a-pipe%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Category:香港粉麵

          List *all* the tuples!

          Channel [V]