Add entry to multiple categories and only show specific parts of a section
3 posts by 2 authors in: Forums > CMS Builder
Last Post: February 23, 2010 (RSS)
Hi guys,
I'm working on a site containing tennis videos and I want my visitors to be able to categorize the videos by "Upload date" and by "Actual date" (the date the match was actually played). I chose category as menu type and am able to sort the videos by upload and actual date, although it's not displayed the way I want it to be.
I'm currently working on a small test that's divided like this:
Australian Open
Australian Open : 2010
Australian Open : 2010 : Final - Federer vs Murray
Australian Open : 2009
Australian Open : 2009 : Final - Federer vs Soderling
If I want to display this sorted by "actual date", it's very easy. I divided it by actual date, so I use the code
The result is:
Australian Open
2010
Final - Federer vs Murray
2009
Final - Federer vs Nadal
Just the result I want to see.
If I want to sort by "upload date" I use the following code:
The result is:
Federer vs Nadal
2009
Final - Federer vs Murray
2010
Australian Open
While I would like the result to be:
Australian Open
2010 (everything is uploaded in 2010)
Federer vs Nadal
Federer vs Murray
Next problem... How do I display only a specific part of a section. Say for example that I only want to display the 2009 Australian Open final. That would mean I'd like to display the main category (Australian Open), subcategory 2 (2009) and the content of subcategory 2 (Final - Federer vs Nadal).
Any idea on how to do this?
Thanks in advance!
I'm working on a site containing tennis videos and I want my visitors to be able to categorize the videos by "Upload date" and by "Actual date" (the date the match was actually played). I chose category as menu type and am able to sort the videos by upload and actual date, although it's not displayed the way I want it to be.
I'm currently working on a small test that's divided like this:
Australian Open
Australian Open : 2010
Australian Open : 2010 : Final - Federer vs Murray
Australian Open : 2009
Australian Open : 2009 : Final - Federer vs Soderling
If I want to display this sorted by "actual date", it's very easy. I divided it by actual date, so I use the code
'orderBy' => 'globalOrder',
The result is:
Australian Open
2010
Final - Federer vs Murray
2009
Final - Federer vs Nadal
Just the result I want to see.
If I want to sort by "upload date" I use the following code:
'orderBy' => 'createdDate DESC',
The result is:
Federer vs Nadal
2009
Final - Federer vs Murray
2010
Australian Open
While I would like the result to be:
Australian Open
2010 (everything is uploaded in 2010)
Federer vs Nadal
Federer vs Murray
Next problem... How do I display only a specific part of a section. Say for example that I only want to display the 2009 Australian Open final. That would mean I'd like to display the main category (Australian Open), subcategory 2 (2009) and the content of subcategory 2 (Final - Federer vs Nadal).
Any idea on how to do this?
Thanks in advance!
Re: [Hansaardappel] Add entry to multiple categories and only show specific parts of a section
By Chris - February 23, 2010
Hi Hansaardappel,
Category Menus are only useful when there's only one "view" for your data. I think you'd be better off with a Multi Record section, which gives you a lot more versatility. You can add fields for "conference", "year", "match", and "date". Alternately, you could use dragSortOrder instead of having a "date" field.
When you're listing by Actual Date, you can orderBy "date" (or "dragSortOrder" if you've gone that route), then generate headings while iterating through your records by printing the conference or year if it's different than the last record's conference/year.
When you're listing by Upload Date, you can orderBy "createdDate" and generate headings the same way.
Finally, you'll also be able to filter your results using this approach. You can specify in a where clause (or often just in the query string of a webpage) that you want to only list records which have conference="Australian Open" and year="2009".
Please let me know if you want more details on how to do any of this.
Category Menus are only useful when there's only one "view" for your data. I think you'd be better off with a Multi Record section, which gives you a lot more versatility. You can add fields for "conference", "year", "match", and "date". Alternately, you could use dragSortOrder instead of having a "date" field.
When you're listing by Actual Date, you can orderBy "date" (or "dragSortOrder" if you've gone that route), then generate headings while iterating through your records by printing the conference or year if it's different than the last record's conference/year.
When you're listing by Upload Date, you can orderBy "createdDate" and generate headings the same way.
Finally, you'll also be able to filter your results using this approach. You can specify in a where clause (or often just in the query string of a webpage) that you want to only list records which have conference="Australian Open" and year="2009".
Please let me know if you want more details on how to do any of this.
All the best,
Chris
Chris
Re: [chris] Add entry to multiple categories and only show specific parts of a section
Thanks, I'm gonna give it a shot!