Forums / Cotonti / Support / Multiple lists

Hodges
#1 2011-09-19 16:48

Hi,

How do I enable multiple lists of pages to be shown at once?

For instance, being able to list pages belonging to category of path 1.1, and in a new list on the same webpage, list pages belonging to category of path 1.2 where both category of path 1.1 and category of path 1.2 belong to category of path 1.

Cheers,
Hodges

GHengeveld
#2 2011-09-19 21:21

That will require a plugin. You can have a look at CombiLists. Although it does something similar to what you want, it's not the same. It simply combines items from multiple categories into a single list. Perhaps you can modify it.

Hodges
#3 2011-09-20 10:22

I was afraid of that; it's been so long!

Well, here's a list.tpl:

<!-- BEGIN: MAIN -->

	<div class="mboxHD">
	{LIST_PAGETITLE}<div class="mboxHDright">{LIST_CATDESC} &nbsp; &nbsp; {LIST_SUBMITNEWPAGE}</div></div>
	<div class="mboxBody">
	
	<h1>{LIST_CATTITLE}</h1>
	
	<div style="text-align:justify;margin: 0px 0px 20px 0px">{PHP.cfg.freetext3}</div>
	<!-- BEGIN: LIST_SUBLIST -->
		<table class="cells">
			<tr>
				<td class="coltop">{LIST_TOP_TITLE} {LIST_TOP_COUNT}</td>
				<td class="coltop" style="width:96px;">{LIST_TOP_DATE}</td>
			</tr>
			<!-- BEGIN: LIST_ROW -->
			<tr class="{LIST_ROW_ODDEVEN}">
				<td>
					<strong><a href="{LIST_ROW_URL}">{LIST_ROW_TITLE}</a></strong> {LIST_ROW_FILEICON}<br />
					<span class="desc">{LIST_ROW_DESC} ({PHP.L.Hits}: {LIST_ROW_COUNT})</span>
				</td>
				<td class="centerall">{LIST_ROW_DATE}</td>
			</tr>
		<!-- END: LIST_ROW -->

		</table>
	<!-- END: LIST_SUBLIST -->
</div>

<!-- END: MAIN -->

New tags are LIST_SUBLIST.

As far as the plugin goes, it needs to:

  1. Read parent path(s) from plugin config (e.g. 1.1).
  2. For each path see if(exists) daughter categories (e.g. 1.1.1, 1.1.2, 1.1.3).
  3. Then assign each page of daughter categories to a new row in a new list (e.g. 4 pages from 1.1.1, 2 pages from 1.1.2 and 5 pages from 1.1.3).
  4. When localhost/list.php?c=apples is requested (and apples has path 1.1) then all lists (1.1.1, 1.1.2, and 1.1.3) are displayed on the same page.

I have no idea how to begin implementing this! frown