2017-06-22 3 views
0

私はTYPO3 8.7を使用しています。現在のページフッターに、現在のページと同じsys_categoryのタイトルを表示したいとします。ユーザーがページの下部に到達すると、「関連するページ」が見つかる。これらのページには現在のページの同じsys_categoryのuidがある。これはtyposcriptで行うことができますか?現在のページと同じsys_categoryで他のページタイトルを取得する方法

私はこのコードを試してみましたが、これは動作しませんでした:

temp.relatedCAT = CONTENT 
temp.relatedCAT { 
    table = pages 
    select { 
    // dontCheckPid doesn't exist for CONTENT objects, so make it recursive from root page (or pidInList.data = leveluid:-2 
    pidInList = {$pidRoot} 
    recursive = 99 
    selectFields = sys_category.uid as catUid 
    join = sys_category_record_mm ON pages.uid = sys_category_record_mm.uid_foreign JOIN sys_category ON sys_category.uid = sys_category_record_mm.uid_local 
    where = sys_category_record_mm.tablenames = 'pages' AND sys_category_record_mm.uid_foreign = {TSFE:id} 
    where.insertData = 1 
    // not necessary for this use case 
    // orderBy = sys_category.sorting 
    } 
    renderObj = TEXT 
    renderObj { 
    field = catUid 
    // Hack: if there are no cats selected for a page, all news are displayed 
    // so I just pass a catUid that's quite unlikely 
    wrap = | 
    } 
} 
lib.related > 
lib.related= TEXT 
lib.related { 

       table = pages 
       select { 
         # pid de la racine du site 
         pidInList = 1 
         # récursivité jusqu'au maximum de niveau 
         recursive = 99 
         # jointure sur la sys_cat_mm 
         leftjoin = sys_category_record_mm ON (pages.uid = sys_category_record_mm.uid_foreign) 
         # condition de recherche 
         where = sys_category_record_mm.tablenames = "pages" AND sys_category_record_mm.uid_local = {$temp.relatedCAT} 
         where.insertData = 1 

} 
} 
+0

'lib.related = TEXT'は次のプロパティと一致しません。それは 'lib.related = CONTENT'でしょうか? –

答えて

関連する問題