Page 1 of 1

entries list

PostPosted: Wed Mar 10, 2010 2:58 am
by suaide
Hello all

Is there a way I can create a list of all entries in a given category inside another entry? For example, I have an entry with some information about a course in the univeristy and I created a category named 'course_notes'. In this entry I give general information about the course and want to make a list with links for all entries in the category 'course_notes'. In pivot 1.X there was an extension that allowed me to do this. Is there an extension in pivotX or some other way I can use to get the same thing?

Best regards

Alex Suaide
http://www.dfn.if.usp.br/~suaide

Re: entries list

PostPosted: Wed Mar 10, 2010 4:49 am
by Stingray
Funny you should ask this. I wrote one that might do what you're looking for, but I haven't released it as I wrote it simply for my use (thinking it wouldn't be something others in the PivotX community would want to use). I call it listbyyear. The format is highly customizable, but for a sample output, check out http://geoffrey.famwagner.com/?p=sermons.

Re: entries list

PostPosted: Wed Mar 10, 2010 10:14 am
by suaide
Dear Stingray

This is exactly what I am looking for. Would you mind to share or just send me some information on the necessary queries to the pivotX database in order to produce this list?

Best regards

Alex Suaide
http://www.dfn.if.usp.br/~suaide

Re: entries list

PostPosted: Wed Mar 10, 2010 10:27 am
by hansfn
Is there a way I can create a list of all entries in a given category inside another entry?

Yes, just use a subweblog inside the entry. (To me it sounds as you should use a page in stead of an entry, but it doesn't matter.) Just insert something like the following:

Code: Select all
[[ subweblog name="listofentries" category="categoryid" ]]
[[ literal ]]
            <p><a href="[[ link hrefonly=1 ]]">[[title]]</a> </p>
[[ /literal ]]
[[ /subweblog ]]

The subweblog tag is extremely flexible - see the documentation.

PS! I'm guessing that even Stingray's listbyyear extension can be replaced by a simple subweblog using the "date" parameter

Re: entries list

PostPosted: Wed Mar 10, 2010 11:49 am
by suaide
Dear Hansfn

Thanks for the information. It is easier than I would expect. I am more and more convinced that pivotX is indeed a big step forward.

Re: entries list

PostPosted: Wed Mar 10, 2010 2:53 pm
by Stingray
Okay...I better understand what you were trying to do.

While my extension could do it, using subweblog would be cleaner for your purposes. I wrote listbyyear to break up the list by calendar years. One would pass a year through the snippet from where it would start (or stop, depending on listing order), and it would create the list of entries through that year, skipping years that there were no entries in the supplied category.

For instance, a look at http://geoffrey.famwagner.com/?p=hymns would show years being skipped. In its simplest usage, to create that list, the usage would be [[ listbyyear year="2002" category="hymns" sort="desc" ]]

Re: entries list

PostPosted: Wed Mar 10, 2010 3:30 pm
by suaide
Dear Stingray

I think the subweblog is enough for my purposes. But thanks anyway for the help.

Best regards