We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29197
    • 13 Posts
    Hello,

    I implement MODx in some site and I have problem to make a list of positions properly as in subject.

    Help please smiley
      • 5340
      • 1,624 Posts
      2 ways come to mind

      1. 4 pages - one shows 5, one shows 20 etc
      2. use javascript: Using your favorite javascript framework you can hide/show div’s. In your case if someone clicks on 5 you show only 5, clicks on 10 you show only 10.


        • 29197
        • 13 Posts
        The first option should solve the problem, but how to pass parameters between these pages? I have a page with text, images and content from tvs. I want to show them on these pages also.
          • 5340
          • 1,624 Posts
          I think the easiest solution is to do like. It’s longer but involves no coding

          1. Create a new Template and paste [!FirstChildRedirect!]. Name the template whatever you want. Assign whatever TVs you need. This will redirect your regular content page to the first "Show" page. Probably "Show 5".
          2. Create your normal content page using the template above and paste you content in the content area.

          3. Create a new template called Show. Paste the template you would normally paste in the page created above.
          3a. You can use wayfinder to show the nav menu (Show 5, Show 20, Show All). So paste your wayfinder call in this template
          3b. Put [*showMany*] in the place you want to show the results.
          3c. Replace [*content*] with [[GetField? &parent=`1` &field=`content`]] Note: You might need to install GetField snippet. Use GetField to show other TVs
          4. Create a new TV called showMany and assign it to this template.
          5. Create a page called "Show 5" inside the Content Page and assign the new template.
          6. Leave content area empty but paste your Ditto call in the showMany TV. Your Ditto call should look similar to [[Ditto? &limit=`5`]]
          7. Repeat 5 to 7 for "Show 10", "Show 50" etc

          I’m sorry if I missed any steps smiley