0

I have a articles blog like so:

(parent) Category: News
(child) article: news-1 written by author-tom
(child) article: news-2 written by author-bill

(parent) Category: Sports
(child) article: sports-4 written by author-bill
(child) article: sports-7 written by author-jack

(parent) Category: Weather
(child) article: weather-1 written by author-tom
(child) article: weather-3 written by author-jack

Author name is a template_variable. And for each article I input the author name manually.

The author names are clickable links. And what I want to achieve is that when a user clicks "author-bill", for example, that the user only sees ALL articles written by "author-bill", thus articles news-2 and sports-4. For "author-jack" the same (sports-7 and weather-3).

I cannot allocate a child to two different parents (i.e. to both the "news" category AND to "author-jack" for example...).

I am stuck in thinking about a feasible solution...

4

1 回答 1

0

使用 getResources 在您的所有类别中搜索作者姓名模板变量。您不需要分配多个父母 [尽管如果您坚持这样做,您可以使用资源别名来伪造它]

您的 getResources 看起来像:

[[!getResources?
     &parents=`1,2,3` // your category ids
     &tvFilters=`author_name==[[+author_name]]` //pass the author in a placeholder

etc. 

阅读文档:http ://rtfm.modx.com/extras/revo/getresources

于 2015-03-15T19:10:08.217 回答