We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15162
    • 59 Posts
    Hello everyone. I searched the forums using a wide variety of different keywords, but didn’t find me an answer yet. If this has been discussed somewhere already I’m willing to take links tongue

    The problem is this; in the front page all the newest "resources" are visible fetched with a Ditto call. This is a solution I’m not comfortable with. I’d like to have a system where visitors can filter the content how they feel.

    Example;
    If I were to have a website focused on food and I’d have three types of articles; drinks, desserts and main courses, they would all be display on the front page in the order they were created. Now, if I were to have a visitor who would only want to know about desserts it would be hard for the visitor to find the desserts from the list with everything else in it. A solution for this would be a button (titled for example "Desserts") which would only show articles filed under "desserts".

    I’m so bad at explaining things embarrassed

    So I’m trying to find a way where, with a push of a button, the user can change the ditto call so that it will fetch the right resources/articles/etc. The most easiest way would be to create multiple templates and slapping different chunks in them, but I really don’t want to do it this way. There must be a simpler solution. I’m willing take any advice you have to offer.
      • 26016
      • 561 Posts
      Answering someone else’s question, I came up with a kludgy way to do this using Ditto. In a nutshell, you have a main Ditto document with your default sort, and it shows links to other Ditto pages that are totally identical, but with their own different sort, and they all link to each other. "Sort by blah"... "Sort by dork" and so on. Crude, but could work.

      http://modxcms.com/forums/index.php/topic,45722.msg270708.html#msg270708

      For someone with more time to play, JQuery could be used for this. You could do several Ditto calls on a page, and use JQuery to vanish/show each of them in turn, complete with fun sliding or fading. That is really fun and sexy looking, but a fair amount of work.
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 15162
        • 59 Posts
        Quote from: samba at Feb 23, 2010, 12:33 PM

        Answering someone else’s question, I came up with a kludgy way to do this using Ditto. In a nutshell, you have a main Ditto document with your default sort, and it shows links to other Ditto pages that are totally identical, but with their own different sort, and they all link to each other. "Sort by blah"... "Sort by dork" and so on. Crude, but could work.

        http://modxcms.com/forums/index.php/topic,45722.msg270708.html#msg270708

        For someone with more time to play, JQuery could be used for this. You could do several Ditto calls on a page, and use JQuery to vanish/show each of them in turn, complete with fun sliding or fading. That is really fun and sexy looking, but a fair amount of work.
        You’re probably right, I should just hang with that. It’s probably the best way for me to go as I have never brothered to learn jQuery because I’m lazy. And I should have a backup solution anyway in case JS is enabled. Though I have to admit that some AJAX action could have been cooler than a new page load.

        Thanks for your help!

        Later edit;

        Well, I tried it as you said, but wasn’t 100% satisfied so I searched for a jQuery solution as well. I found "jQuery tabs" which is part of the jQuery UI system. You can find/download/learn from it here; http://jqueryui.com/

        I’m rather pleased with how it works. When JS is turned of it works really bulky, but it does still work.