Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-09-25 05:36:57
- ((slimey))
- Member
- Registered: 2005-06-25
- Posts: 26
File and Categories
Hey hey all,
Im having a hardtime working out how to acheive this set up i want. Let me try to explain.
Its going to be a resource library.
In the files section of the site im developing there are going to be about 10 different areas with different categories inside each area.
Now what i want to do is show in each area a file download link list grouped by categories. So like this
Sales and Marketing
Categories- File download line
- File download line
- File download line
- File download line
- File download line
- File download line
I just dont have any clue how im going to set this up, i guess i would make the area (sales and marketing) a section but how do i go about the file download link list grouped by categories. Id love for a txp tag to be able to do it that way it stays dynamic
Last edited by ((slimey)) (2007-09-25 05:47:16)
Offline
Offline
#3 2007-09-25 05:57:26
- ((slimey))
- Member
- Registered: 2005-06-25
- Posts: 26
Re: File and Categories
Yeah but how do i group them with the category heading above them? Like i did above
Offline
Re: File and Categories
<h3>Another Category</h3>
<txp:file_download_list category="category name" />
Or by using asy_wondertag plugin it would be easy to show currently displayed categorory:
<txp:asy_wondertag><txp:file_download_list category="<txp:category />" /></txp:asy_wondertag>
Cheers!
Offline
Re: File and Categories
or if you want what gocom suggested all within the tag:
<txp:file_download_list category="category name" wraptag="ul" break="li" labeltag="h3" label="Category Heading" />
the only issue is you’d have to slap the aforementioned tag into your page for however many file categories you have:
<txp:file_download_list category="category name" wraptag="ul" break="li" labeltag="h3" label="Category Heading 1" />
<txp:file_download_list category="another category" wraptag="ul" break="li" labeltag="h3" label="another Category Heading 2" />
<txp:file_download_list category="yet another category" wraptag="ul" break="li" labeltag="h3" label="yet another Category Heading 3" />
etc etc
i’m unaware of any other method to automatically output EVERY file category for a specific area with their files underneath them though as i usually don’t deal with files much. maybe someone else can chime in with a more optimal method.
Last edited by iblastoff (2007-09-25 08:31:33)
Offline
#6 2007-09-25 09:04:34
- ((slimey))
- Member
- Registered: 2005-06-25
- Posts: 26
Re: File and Categories
Ive been talking with my client who i am doing this for.
We are going down this path instead. Sales and marketing area will be a page/article cause she want text explaining what files are in that area.
Then on that same page there will be links of to the different categories and files.
SO in a sense now i just need to list the categorys and link them to the files, suggested ways of doing that anyone.
Offline
#7 2007-09-25 17:26:05
- ((slimey))
- Member
- Registered: 2005-06-25
- Posts: 26
Re: File and Categories
Well i worked on my problem and solved it… alot of fiddling and one plugin and finally got it.
Because there are going to be set sections which act as the main areas of the files page i am able to hard code that part but then the rest is pretty much dynamic.
Heres my code
<txp:if_section name="sales_materials">
<txp:article limit="1" />
<txp:asy_wondertag>
<txp:category_list break="li" label="File Categories" labeltag="h2" parent="<txp:section />"
type="file" wraptag="ul" this_section="1" />
</txp:asy_wondertag>
</txp:if_section>
<txp:if_category>
<txp:asy_wondertag>
<txp:file_download_list category="<txp:category />" form="test" />
</txp:asy_wondertag>
</txp:if_category>
It works like this, you click on Sales Materials in a drop down menu, you go to that section it will display the article for that section which explains what files you will find there. Then under that you have your section specific file category links. Click on the link you need and it returns you to the same page again but now displays the files you wanted.
The only catch with this set up is the section name has to be the same as the parent/normal category otherwise the category list wont work. But it works great for what i need it to do and if i set up the categories for my client (like i would normally do anyway) and tell them not to delete them or change them there shouldnt be any troubles.
Can anyone expand on this idea to something simpler or is this as simple as it will get?
Tell us what ya think to
Cheers
Sean
Offline
#8 2008-05-22 07:03:48
- azw
- Member
- Registered: 2007-01-29
- Posts: 279
Re: File and Categories
Sean, I’m interested in doing something very similar. Do you have a URL I can look at to see how this worked?
Offline
Pages: 1