Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
txp:file_download_list is with new attr - ID (and make it container)
What could be better, than use such code:
<txp:file_download_list id="1,2,3,4,6,88,32">
<txp:file_download_link />
</txp:file_download_list>
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
#2 2008-11-18 01:21:32
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: txp:file_download_list is with new attr - ID (and make it container)
file_download_list, at the latest commit, will work as a container tag, as will file_download_link, but the point nevertheless has some merit given that it falls in the area between, but not quite accomplishing, the function of both.
Another alternative that might be worth some thought would be an “if_download_id” tag, this way you could nest your file_download tags within your conditionals to both select ids and customize output.
Give this a spin. It should work in TXP 4.0.6 in a file form. (ras_if_download_id)
# Name: ras_if_download_id v4.0.7.dev
# Type: Client side plugin
# Conditional tag that tests for a download id or list of ids.
# Author: raas
# URL: http://textcastle.com
# .....................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................
YTo5OntzOjQ6Im5hbWUiO3M6MTg6InJhc19pZl9kb3dubG9hZF9pZCI7czo2OiJhdXRob3Ii
O3M6NDoicmFhcyI7czoxMDoiYXV0aG9yX3VyaSI7czoyMToiaHR0cDovL3RleHRjYXN0bGUu
Y29tIjtzOjc6InZlcnNpb24iO3M6OToiNC4wLjcuZGV2IjtzOjExOiJkZXNjcmlwdGlvbiI7
czo2MDoiQ29uZGl0aW9uYWwgdGFnIHRoYXQgdGVzdHMgZm9yIGEgZG93bmxvYWQgaWQgb3Ig
bGlzdCBvZiBpZHMuIjtzOjQ6ImNvZGUiO3M6MjM4OiIJZnVuY3Rpb24gcmFzX2lmX2Rvd25s
b2FkX2lkKCRhdHRzLCAkdGhpbmcpDQoJew0KCQlnbG9iYWwgJHRoaXNmaWxlOw0KCQlhc3Nl
cnRfZmlsZSgpOw0KDQoJCWV4dHJhY3QobEF0dHMoYXJyYXkoDQoJCQknaWQnID0+ICcnLA0K
CQkpLCAkYXR0cykpOw0KDQoJCWlmICgkaWQpDQoJCXsNCgkJCXJldHVybiBwYXJzZShFdmFs
RWxzZSgkdGhpbmcsIGluX2xpc3QoJHRoaXNmaWxlWydpZCddLCAkaWQpKSk7DQoJCX0NCgl9
IjtzOjQ6InR5cGUiO3M6MToiMCI7czo0OiJoZWxwIjtzOjE2MDoiPGgyPnJhc19pZl9kb3du
bG9hZF9pZDwvaDI+Cgo8cD4gQXR0cmlidXRlczwvcD4KPHVsPgo8bGk+aWQgJmJ1bGw7ICJp
bnRlZ2VyIiA6IHdpbGwgYWNjZXB0IGNvbW1hIGRlbGltaXRlZCBsaXN0LjwvbGk+CjwvdWw+
CjxwPlNob3VsZCBiZSB1c2VkIGluIGEgZmlsZSBmb3JtPC9wPiI7czozOiJtZDUiO3M6MzI6
ImEwMzE5ZmQyM2U0NzllYWRmYWMzODFlMmNmNzA4NGU0Ijt9
Last edited by rsilletti (2008-11-18 01:40:38)
Offline
#3 2008-11-18 01:56:21
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: txp:file_download_list is with new attr - ID (and make it container)
After testing a little, this works. It has the same drawback as using conditionals inside a links list though, the list tag returns the desired markup even when the conditional returns no content – would be nice to have the id list available in the file_download_list tag for that reason.
Offline