We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6623
    • 127 Posts
    How? Something like this [!Ditto? &field=`pagetitle,menuindex,introtext` !]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      That would be handled in the tpl, using placeholders [+pagetitle+] [+menuindex+] [+introtext+]
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 6623
        • 127 Posts
        I know, but I do not need menuindex field in the template. It is necessary for sorting. Now I’m doing something like this
        [!Ditto? &tpl=`tpl` $orderBy=`menuindex`!]
        and tpl:
        <div class=’[+menuindex+]’>[+pagetitle+]</div>
        This [+menuindex+] is stub, nothing more... It’s not a good practic... How skip over this "bug"
          • 28042 ☆ A M B ☆
          • 24,524 Posts
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 6623
            • 127 Posts
            Quote from: sottwell at May 14, 2010, 01:42 AM

            http://www.pogwatch.com/ditto/ditto-sort.html
            Thank you of course, but I have MySQL error when i try &orderby = `menuindeh DESC`. MySQL error about the fact that such a field menuindex is not requested ...
            P.S. about all standart parameters i know, but i not find param for this problem. And I do not understand what language on the page at url
              • 16278
              • 928 Posts
              @DAS: Judging by other posts you are a Russian speaker. А как раз автор Погуатча (т.е. я) немножко по-русски понимает!

              Сортировка вывода по определенным полям
              Ditto 2.1 параметр для сортировки вывода – &orderBy, который заменяет Ditto 2.0 параметры &sortBy и &sortDir. Сортировать можно по любому полю или TV. Обязательно указать направление сортировки (ASC [вверх] или DESC [вниз]). Направление отделяется от имени поля пробелом. Сортировка по умолчанию – `createdon DESC`.
              ... [эксемпляры] ...
              Можно запросить складную сортировку, используя список полей+направлений, отделенных запятой.

              Надеюсь, это поможет. Если нет, давайте пож. по-русски все подробности: что нужно, и что попробовали, в форме копи-пейст самого Ditto вызова. Если речь идет о orderBy, то у меня отлично работает на одной странице параметр в виде &orderBy=`pkDate DESC,menuindex DESC`. Кстати, как и все параметры, он задается символом &, не $.
              rolleyes KP
                • 6623
                • 127 Posts
                Хорошо, по русски:
                Вызываю: [!Ditto? &tpl=`tpl` $orderBy=`menuindex DESC`!]
                Содержание `tpl`:
                <div class=’menuElm’>[+pagetitle+]</div>
                Возвращает ошибку MySQL о том что такое поле не существует(menuindex).
                Добавляем в шаблоне обращение к [+menuindex+](вот так: <div class=’menuElm [+menuindex+]’>[+pagetitle+]</div>) и все работает.