Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-11-19 21:35:46

straumanis
New Member
Registered: 2010-11-19
Posts: 3

List of published authors by section

How do I generate a list of authors who have published in a specific section, without having the author’s name repeat for every article?

Imagine if a site has 5 authors, some of whom have published in all sections, some of whom have published in just some sections and some, perhaps, who have not published at all. Is it possible to generate lists like this…

Section A
author1
author2
author3

Section B
author1
author3
author4

Section C
author1
author4

But author5 has not published anything and should not appear in a list until they do.

Offline

#2 2010-11-19 22:03:01

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: List of published authors by section

I’ve never used it but I think this is the sort of thing you can use txp:if_different for.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#3 2010-11-19 22:18:52

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: List of published authors by section

I think this does it…

<ul>
<txp:section_list>
<li>
<txp:section title="1"/>
<ul>
<txp:article_custom section='<txp:section />' sort="AuthorID">
 <txp:if_different>
<li><!--<txp:section />--><txp:author/></li>
 </txp:if_different>
</txp:article_custom>
</ul>
</li>
</txp:section_list>
</ul>

Strangly enough with out the hidden section name if_different made it only display the author name once on my site where I am the only author.

Last edited by MattD (2010-11-20 03:54:50)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#4 2010-11-20 02:25:21

straumanis
New Member
Registered: 2010-11-19
Posts: 3

Re: List of published authors by section

Thanks, but that just gave me a list of all sections. I need a list of authors published in each section.

Offline

#5 2010-11-20 03:57:37

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: List of published authors by section

Really? It gives me a list of sections and authors. Like this

I was missing a closing ul above and have edited it to correct this.

Last edited by MattD (2010-11-20 04:01:32)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#6 2010-11-20 04:20:48

straumanis
New Member
Registered: 2010-11-19
Posts: 3

Re: List of published authors by section

Perhaps the missing “ul” was it. Now it works. Thank you!

Offline

Board footer

Powered by FluxBB