I was recently faced with this question for a project, and there didn't seem to be a tag or attribute readily available for this sort of thing. So after I submitted a feature request, I cooked up this little tidbit:
Blogs by Maarten Schenk:
<mt:blogs>
<mt:authors>
<mt:if tag="authordisplayname" eq="Maarten Schenk"><li><mt:blogurl></li></mt:if>
</mt:authors>
</mt:blogs>​
<mt:blogs>
<mt:authors>
<mt:if tag="authordisplayname" eq="Maarten Schenk"><li><mt:blogurl></li></mt:if>
</mt:authors>
</mt:blogs>​
This results in a nice list of all blogs on which I have a role in this installation:
Blogs by Maarten Schenk:http://www.movabletips.com/ http://www.movabletips.com/test/ http://www.yesitcan.be/
If you put following snippet in a context where an author is present (for example, an entry, an author archive...) you can generate the list for any arbitrary author:
<mt:authordisplayname setvar="thename">
Blogs by <mt:var name="thename">:
<mt:blogs>
<mt:authors>
<mt:if tag="authordisplayname" eq="$thename"><li><mt:blogurl></li></mt:if>
</mt:authors>
</mt:blogs>​
Blogs by <mt:var name="thename">:
<mt:blogs>
<mt:authors>
<mt:if tag="authordisplayname" eq="$thename"><li><mt:blogurl></li></mt:if>
</mt:authors>
</mt:blogs>​
For installations with up to a few hundred blogs or authors this should prove workable. Any larger, and the authors loop inside the blogs loop might slow down publishing. In cases like that it is probably a good idea to use a special author archive for each author which outputs this list in a file with the name or ID of the author in the filename, and then to include this file whenever the list of blogs for that author is needed.
Tweet
Leave a comment