Отзывы о сайте через Tickets

Есть сайт itq.by/, хочу на главной странице — вывести последние три комментария, сама страница с отзывами itq.by/kommentarii.html,
будьте так добры, подскажите как это можно сделать.
+ сайт сделали на bootstrap, интересно было бы услышать критику или советы что можно улучшить еще.
Заранее благодарю.
Денис Куприяник
12 февраля 2013, 11:39
modx.pro
1
2 303
0

Комментарии: 20

Василий Наумкин
12 февраля 2013, 15:52
0
Изучай сниппет TicketLatest, там есть параметры для вывода последних тикетов или комментов.

Есть и ограничение выборки.
Денис Куприяник
13 февраля 2013, 11:19
0
вызываю последние комментарии сниппетом
[[!TicketLatest? &limit=`3` &parents=`68` &tpl=`tpl.Tickets.comment.latest.main` ]]

68 — id тикета отзывы (страница itq.by/kommentarii.html), и оттуда надо вытянуть последние 3 комментария, но выводится только 1, как выводится видно на главной itq.by/

Почему то сниппет вообще не реагирует на параметр limit.
    Andrei Kilin
    13 февраля 2013, 11:40
    0
    &action=`comments`, не?
    Денис Куприяник
    13 февраля 2013, 11:49
    0
    не…
      Денис Куприяник
      13 февраля 2013, 12:05
      0
      Люди добрый подскажите куда еще смотреть, пожалуйста.
        Andrei Kilin
        13 февраля 2013, 12:28
        0
        Кеш почистить, опечатки посмотреть, чанк родной использовать, action всеже включить в запрос. Проверил со всеми возможными параметрами, все работает из коробки.
          Денис Куприяник
          13 февраля 2013, 13:18
          0
          ок. извиняюсь если я туплю. но может стоит уточнить вопрос: необходимо вывести не 3 последних тикета с комментарием, а 3 последних комментария из одного тикета! (этот один тикет — страница с отзывами о сайте)
          [[!TicketLatest? &action=`comments` &limit=`3` &showLog=`0` &tpl=`tpl.Tickets.comment.latest`]]
          вызывает только по 1 тикету с комментарием((
            Andrei Kilin
            13 февраля 2013, 13:32
            0
            Вкурил. ТикетЛатест в данном варианте выводит именно тикеты из разделов указанных, либо тикеты с последними комментами, как это поправить я некопенгаген.
            Ваш подход, по-моему, немного на будущее не рассчитан: если будет 100500 комментариев — они будут выводиться в бооольшую портянку.
            Почему не сделать несколько секций разных с Жалобами, Благодарностями и Вопросами, например, а там уже выводить последние записи по родителям, тут можно использовать пагинацию уже, да еще и комментарии можно прикрутить к жалобам и предложениям, чтобы не плодить одинаковые?
              Василий Наумкин
              13 февраля 2013, 14:14
              0
              Вот этим можно, думаю — rtfm.modx.com/display/ADDON/Rowboat.Rowboat
                Денис Куприяник
                13 февраля 2013, 15:07
                0
                заработало. спасибо.
                [[!Rowboat? &tpl=`tpl.Tickets.comment.latest.main` &table=`modx_tickets_comments` &limit=`3`]]
                  Сергей
                  24 декабря 2014, 04:09
                  0
                  Доброго времени суток, Василий! Как этим способом вывести [[+properties.key]]? Может допилишь возможность выводить именно последние комментарии без тикетов и пагинацию комментариев когда нельзя отвечать на них? Покроет сразу остальные 50% случаев, где можно использовать компонент из коробки :)
                    Василий Наумкин
                    24 декабря 2014, 06:56
                    +1
                    В тикетах давно есть сниппет getComments — он тебе нужен.
                      Сергей
                      25 декабря 2014, 09:51
                      0
                      Добрый день, Василий! Или я разобраться не могу, или вопрос неверно задаю. Нужно вывести последние три комментария (не тикета), getComments возвращает мне 0 строк. Rowboat возвращает то что нужно, но он не выводит [[+properties.key]]. Нужен по идее сниппет по аналогии с TicketLatest, только с выводом последних комментариев, а не прокомментированных сниппетов.
                        Максим Кузнецов
                        25 декабря 2014, 10:07
                        +1
                        Включи лог и посмотри результаты работы getComments. Он — то, что тебе нужно.
                          Сергей
                          25 декабря 2014, 10:14
                          0
                          [[!getTickets? &tpl=`tpl.Tickets.comment.one.auth` &limit=`3` &includeContent=`1` &parents=`0` &showLog=`1`]]
                          0.0001659: Query parameters are prepared.
                          0.0000451: xPDO query object created
                          0.0002501: leftJoined TicketsSection as Section
                          0.0002141: leftJoined modUser as User
                          0.0002120: leftJoined modUserProfile as Profile
                          0.0000031: Grouped by Ticket.id
                          0.0001118: Added selection of TicketsSection: SQL_CALC_FOUND_ROWS `id` AS `section.id`, `type` AS `section.type`, `contentType` AS `section.contentType`, `pagetitle` AS `section.pagetitle`, `longtitle` AS `section.longtitle`, `description` AS `section.description`, `alias` AS `section.alias`, `link_attributes` AS `section.link_attributes`, `published` AS `section.published`, `pub_date` AS `section.pub_date`, `unpub_date` AS `section.unpub_date`, `parent` AS `section.parent`, `isfolder` AS `section.isfolder`, `introtext` AS `section.introtext`, `richtext` AS `section.richtext`, `template` AS `section.template`, `menuindex` AS `section.menuindex`, `searchable` AS `section.searchable`, `cacheable` AS `section.cacheable`, `createdby` AS `section.createdby`, `createdon` AS `section.createdon`, `editedby` AS `section.editedby`, `editedon` AS `section.editedon`, `deleted` AS `section.deleted`, `deletedon` AS `section.deletedon`, `deletedby` AS `section.deletedby`, `publishedon` AS `section.publishedon`, `publishedby` AS `section.publishedby`, `menutitle` AS `section.menutitle`, `donthit` AS `section.donthit`, `privateweb` AS `section.privateweb`, `privatemgr` AS `section.privatemgr`, `content_dispo` AS `section.content_dispo`, `hidemenu` AS `section.hidemenu`, `class_key` AS `section.class_key`, `context_key` AS `section.context_key`, `content_type` AS `section.content_type`, `uri` AS `section.uri`, `uri_override` AS `section.uri_override`, `hide_children_in_tree` AS `section.hide_children_in_tree`, `show_in_tree` AS `section.show_in_tree`, `properties` AS `section.properties`
                          0.0000210: Added selection of modUser: `username`
                          0.0000350: Added selection of modUserProfile: `internalKey`, `fullname`, `email`, `phone`, `mobilephone`, `blocked`, `blockeduntil`, `blockedafter`, `logincount`, `lastlogin`, `thislogin`, `failedlogincount`, `sessionid`, `dob`, `gender`, `address`, `country`, `city`, `state`, `zip`, `fax`, `photo`, `comment`, `website`, `extended`
                          0.0000520: Added selection of Ticket: `id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `link_attributes`, `published`, `pub_date`, `unpub_date`, `parent`, `isfolder`, `introtext`, `content`, `richtext`, `template`, `menuindex`, `searchable`, `cacheable`, `createdby`, `createdon`, `editedby`, `editedon`, `deleted`, `deletedon`, `deletedby`, `publishedon`, `publishedby`, `menutitle`, `donthit`, `privateweb`, `privatemgr`, `content_dispo`, `hidemenu`, `class_key`, `context_key`, `content_type`, `uri`, `uri_override`, `hide_children_in_tree`, `show_in_tree`, `properties`
                          0.0000250: Processed additional conditions
                          0.0003350: Added where condition: class_key=Ticket, Ticket.published=1, Ticket.deleted=0
                          0.0000570: Sorted by Ticket.createdon, DESC
                          0.0000079: Limited to 3, offset 0
                          0.0005081: SQL prepared "SELECT SQL_CALC_FOUND_ROWS `Section`.`id` AS `section.id`, `Section`.`type` AS `section.type`, `Section`.`contentType` AS `section.contentType`, `Section`.`pagetitle` AS `section.pagetitle`, `Section`.`longtitle` AS `section.longtitle`, `Section`.`description` AS `section.description`, `Section`.`alias` AS `section.alias`, `Section`.`link_attributes` AS `section.link_attributes`, `Section`.`published` AS `section.published`, `Section`.`pub_date` AS `section.pub_date`, `Section`.`unpub_date` AS `section.unpub_date`, `Section`.`parent` AS `section.parent`, `Section`.`isfolder` AS `section.isfolder`, `Section`.`introtext` AS `section.introtext`, `Section`.`richtext` AS `section.richtext`, `Section`.`template` AS `section.template`, `Section`.`menuindex` AS `section.menuindex`, `Section`.`searchable` AS `section.searchable`, `Section`.`cacheable` AS `section.cacheable`, `Section`.`createdby` AS `section.createdby`, `Section`.`createdon` AS `section.createdon`, `Section`.`editedby` AS `section.editedby`, `Section`.`editedon` AS `section.editedon`, `Section`.`deleted` AS `section.deleted`, `Section`.`deletedon` AS `section.deletedon`, `Section`.`deletedby` AS `section.deletedby`, `Section`.`publishedon` AS `section.publishedon`, `Section`.`publishedby` AS `section.publishedby`, `Section`.`menutitle` AS `section.menutitle`, `Section`.`donthit` AS `section.donthit`, `Section`.`privateweb` AS `section.privateweb`, `Section`.`privatemgr` AS `section.privatemgr`, `Section`.`content_dispo` AS `section.content_dispo`, `Section`.`hidemenu` AS `section.hidemenu`, `Section`.`class_key` AS `section.class_key`, `Section`.`context_key` AS `section.context_key`, `Section`.`content_type` AS `section.content_type`, `Section`.`uri` AS `section.uri`, `Section`.`uri_override` AS `section.uri_override`, `Section`.`hide_children_in_tree` AS `section.hide_children_in_tree`, `Section`.`show_in_tree` AS `section.show_in_tree`, `Section`.`properties` AS `section.properties`, `User`.`username`, `Profile`.`internalKey`, `Profile`.`fullname`, `Profile`.`email`, `Profile`.`phone`, `Profile`.`mobilephone`, `Profile`.`blocked`, `Profile`.`blockeduntil`, `Profile`.`blockedafter`, `Profile`.`logincount`, `Profile`.`lastlogin`, `Profile`.`thislogin`, `Profile`.`failedlogincount`, `Profile`.`sessionid`, `Profile`.`dob`, `Profile`.`gender`, `Profile`.`address`, `Profile`.`country`, `Profile`.`city`, `Profile`.`state`, `Profile`.`zip`, `Profile`.`fax`, `Profile`.`photo`, `Profile`.`comment`, `Profile`.`website`, `Profile`.`extended`, `Ticket`.`id`, `Ticket`.`type`, `Ticket`.`contentType`, `Ticket`.`pagetitle`, `Ticket`.`longtitle`, `Ticket`.`description`, `Ticket`.`alias`, `Ticket`.`link_attributes`, `Ticket`.`published`, `Ticket`.`pub_date`, `Ticket`.`unpub_date`, `Ticket`.`parent`, `Ticket`.`isfolder`, `Ticket`.`introtext`, `Ticket`.`content`, `Ticket`.`richtext`, `Ticket`.`template`, `Ticket`.`menuindex`, `Ticket`.`searchable`, `Ticket`.`cacheable`, `Ticket`.`createdby`, `Ticket`.`createdon`, `Ticket`.`editedby`, `Ticket`.`editedon`, `Ticket`.`deleted`, `Ticket`.`deletedon`, `Ticket`.`deletedby`, `Ticket`.`publishedon`, `Ticket`.`publishedby`, `Ticket`.`menutitle`, `Ticket`.`donthit`, `Ticket`.`privateweb`, `Ticket`.`privatemgr`, `Ticket`.`content_dispo`, `Ticket`.`hidemenu`, `Ticket`.`class_key`, `Ticket`.`context_key`, `Ticket`.`content_type`, `Ticket`.`uri`, `Ticket`.`uri_override`, `Ticket`.`hide_children_in_tree`, `Ticket`.`show_in_tree`, `Ticket`.`properties` FROM `modx_site_content` AS `Ticket` LEFT JOIN `modx_site_content` `Section` ON `Section`.`id` = `Ticket`.`parent` LEFT JOIN `modx_users` `User` ON `User`.`id` = `Ticket`.`createdby` LEFT JOIN `modx_user_attributes` `Profile` ON `Profile`.`internalKey` = `User`.`id` WHERE  ( `Ticket`.`class_key` = 'Ticket' AND `Ticket`.`published` = 1 AND `Ticket`.`deleted` = 0 )  GROUP BY Ticket.id ORDER BY Ticket.createdon DESC LIMIT 3 "
                          0.0010991: SQL executed
                          0.0000980: Total rows: 0
                          0.0000200: Rows fetched
                          0.0000129: Returning raw data
                          0.0000060: Returning processed chunks
                          0.0046620: Total time
                          10 747 904: Memory usage
                          В базе есть 3 комментария.
                            Сергей
                            25 декабря 2014, 10:17
                            +1
                            Все заработался. Всем извинения. Использовал getTickets :)
                              Максим Кузнецов
                              25 декабря 2014, 10:20
                              +1
                              [[!getTickets]]
                                Сергей
                                25 декабря 2014, 10:26
                                0
                                Да-да, разобрался. Только со стороны увидел, когда сюда скопировал. Взгляд замылился за 2 дня без сна практически. Еще раз спасибо!
            Николаевич
            25 мая 2017, 16:01
            0
            Есть задача сменить у всех ресурсов class key с modDocument на Ticket
            Скажите, можно ли просто в базе данных заменить значения class key или обязательно совершать это действие через админку?
              Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
              20