We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19033
    • 892 Posts
    こんにちは。よろしくお願い致します。
    スニペット Wayfinderについてなのですが。。

    Wayfinderのパラメータに、startIdというのがあり、
    ドキュメントIDを指定すると、その下のドキュメントをリストアップしますよね。

    で、このstartIDに[[UltimateParent]]を利用して、カレントドキュメントの
    親IDを書き出させたいと思うのですが、以下のようにすると、
    エラーが出てしまうのです。。

    [[Wayfinder? &startID=`[[UltimateParent]]`]]

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « Execution of a query to the database failed - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '[[UltimateParen AND sc.published=1 AND sc.deleted=0 AND (sc.pri »
          SQL: SELECT DISTINCT sc.id,sc.menutitle,sc.pagetitle,sc.introtext,sc.menuindex,sc.published,sc.hidemenu,sc.parent,sc.isfolder,sc.description,sc.alias,sc.longtitle,sc.type,if(sc.type='reference',sc.content,'') as content, sc.template,sc.link_attributes FROM `liolion`.modx_site_content sc LEFT JOIN `liolion`.modx_document_groups dg on dg.document = sc.id WHERE sc.parent = [[UltimateParen AND sc.published=1 AND sc.deleted=0 AND (sc.privateweb=0) AND sc.hidemenu = 0 GROUP BY sc.id ORDER BY sc.menuindex ASC; 


    何が良くないのでしょうか。。
      • 19033
      • 892 Posts
      すみません。。解決したみたいです。。
      [[Wayfinder? &startID=`[[UltimateParent]]`]]

       ↓
      [!Wayfinder? &startID=`[[UltimateParent]]`!]


      キャッシュしない方で、できました。お騒がせしてすみません。。
        • 19033
        • 892 Posts
        Dittoの場合も、キャッシュしない方[!Ditto? &startID=`[[UltimateParent]]`!]じゃないと、
        エラーが出ました(違うエラーでしたが)。ということは、Wayfinderの問題というより、
        [[UltimateParent]]側の"何か(仕様?)"なのかな。。
          • 19033
          • 892 Posts
          こんにちは。

          Wayfinder 2.0にしたところ以下の表記でエラーが出なくなりました。
          ご報告致します。

          [[Wayfinder? &startID=`[[UltimateParent]]`]]


          ※ちなみにエラーが出ていたのはWayfinder1.0です。
            • 19033
            • 892 Posts
            誤情報を流してしまいました。すみません。

            Wayfinder 2.0にしたところ以下の表記でエラーが出なくなりました。
            ご報告致します。

            [[Wayfinder? &startID=`[[UltimateParent]]`]]

            ※ちなみにエラーが出ていたのはWayfinder1.0です。

            上記の書式が有効になったのは、Wayfinderが2.0になったからではなく、
            PHxを導入したためでした。すみません。。

            ちなみに、PHxを導入していない環境でも、
            [[Wayfinder? &startID=`[[UltimateParent]]`]]
            と書いてもエラーは出なくなりましたが、有効な値はかえってきません。

            1.0の場合と同様に、
            [!Wayfinder? &startID=`[[UltimateParent]]`!]
            と書く必要があります。