entries list

Discuss PivotX 2.0.x extensions here, and view extensions that are available for download.

entries list

Postby suaide » Wed Mar 10, 2010 2:58 am

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
suaide
 
Posts: 13
Joined: Wed Mar 10, 2010 2:08 am
Location: University of Sao Paulo, Brazil

Re: entries list

Postby Stingray » Wed Mar 10, 2010 4:49 am

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.
Stingray
 
Posts: 107
Joined: Wed Oct 28, 2009 2:40 pm

Re: entries list

Postby suaide » Wed Mar 10, 2010 10:14 am

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
suaide
 
Posts: 13
Joined: Wed Mar 10, 2010 2:08 am
Location: University of Sao Paulo, Brazil

Re: entries list

Postby hansfn » Wed Mar 10, 2010 10:27 am

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
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: entries list

Postby suaide » Wed Mar 10, 2010 11:49 am

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.
suaide
 
Posts: 13
Joined: Wed Mar 10, 2010 2:08 am
Location: University of Sao Paulo, Brazil

Re: entries list

Postby Stingray » Wed Mar 10, 2010 2:53 pm

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" ]]
Stingray
 
Posts: 107
Joined: Wed Oct 28, 2009 2:40 pm

Re: entries list

Postby suaide » Wed Mar 10, 2010 3:30 pm

Dear Stingray

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

Best regards
suaide
 
Posts: 13
Joined: Wed Mar 10, 2010 2:08 am
Location: University of Sao Paulo, Brazil


Return to 2.x Extensions

Who is online

Users browsing this forum: No registered users and 0 guests

cron