We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3046
    • 48 Posts
    Hello everybody.
    I’m stack with a problem how a user can sort Ditto output just from the frontend page.

    ex. [[Ditto? &orderBy=`[*tv*]`]]

    I thought it would be ok to do it with tv with post or get method
    but after some attempts didn’t find away, may be smb have a simple decision of it?

    Thank you in advance
      • 4172
      • 5,888 Posts
      you can try the request-extender:

      http://ditto.modxcms.com/files/assets/snippets/ditto/extenders/request-extender-inc-php.html

      [!Ditto? &extenders=`request`................!]


      and use this in the url:
      <a href="[~[*id*]~]&ditto_orderBy=yourfield">Order by yourfield</a>
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 3046
        • 48 Posts
        Hello everybody.
        I was trying to make filter thing for ditto with jquery slider, using ditto Request thing

        Here is what i got now, but working scrappy.
        Sry page is in russian http://mkscompany.ru/podbor-oborudovaniya2.html

        This are working sheets:
        The Form with slider
        <form method="post" action="[[getmaker]]">
        			<div class="formVolume">
        				<label for="minVolume">Цена: от</label> <input type="text" name="minVolume" id="textfield" value="0"/>
        				<label for="maxVolume">до</label> <input type="text" name="maxVolume" id="textfield" value="20"/>
        
        			</div>
        			<div class="sliderCont">
        					<div id="slider"></div>
        			</div>
        <input name="" type="submit" value="Поиск"/>
        		</form>
        


        My snippet

        <?php
        	echo '[~[*id*]~]&ditto_filter=template,7,1'; // filter for any request to put only products to results
        	echo '-volume,'.($_POST['minVolume']).',6'; //filter with min value
        	echo '-volume,'.($_POST['maxVolume']).',5'; //filter with max value
        ?>


        The snippet returns:
        http://mkscompany.ru/podbor-oborudovaniya2.html&ditto_filter=template,7,1-volume,0,6-volume,20,5


        It’s ok for me, but there are two problems:
        1. Search button works from second pressing or page renew, or such kind of bug - dont know why
        2. Slider need to keep values, we assumed it last time, now it renew them to default every time.

        Is there any thought?
        Thank you