Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Creating a file download list using a table
When I use <txp:file_download_list … wraptag=“ul” class=“filelist” > I get a nice “<ul class=“filelist”> tag.
If I change wraptag=“ul” to wraptab=“table” then it ignores the class and I just get <table>!
Is this expected behaviour and if so, does anyone have a simple way round it?
Thanks,
Doug.
Offline
Re: Creating a file download list using a table
It’s when you ask a simple question and get no responses that you start to think that maybe you’ve asked a REALLY stupid question and should check the FAQ… can’t see anything obvious though…
Offline
#3 2007-10-23 12:20:57
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Creating a file download list using a table
When I look at this piece of code in function file_download_list:
if ($wraptag == 'ul' or $wraptag == 'ol')
{
return doLabel($label, $labeltag).doWrap($out, $wraptag, $break, $class);
}
the class is only added when using ul or ol. But it looks like you can easily add table yourself.
Last edited by els (2007-10-23 12:26:13)
Offline
Re: Creating a file download list using a table
Thanks for the reply Els. What’s the reason for limiting the class to a wraptag of ul and ol though? Seems a bit restrictive for no real reason!
Offline
#5 2007-10-23 12:49:08
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Creating a file download list using a table
Sorry, I don’t know, you’ll need a developer to answer that one… Probably because it’s a list, and the only proper way to show a list is in list tags?
Offline
Re: Creating a file download list using a table
I’m guess it would be pointless to wait for a “<txp:file_download_table>” tag though! ;-)
I’ve modded the function’s code – now I just need to find a nice obvious place for my virtual post-it note so that I remember next time there’s a txp update.
Offline
Re: Creating a file download list using a table
A better solution would be to write this as a plugin or to submit a patch to the txp-dev mailinglist.
Offline
Re: Creating a file download list using a table
Now you’re going to make me read up on writing plugins and/or submitting patches! ;-)
Offline
#9 2007-10-23 22:20:42
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: Creating a file download list using a table
I’ve a tag that I wrote to display download links in tabular form included with this plugin : download_stats it hasn’t been updated since TXP version g1.19 because there didn’t seem a purpose to do so, but it might give you a starting point.
Offline