Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Ideas for emulating two file download categories?
Bloke wrote #337788:
Or maybe we don’t pass the thing directly to SQL but preprocess it? Internally replace underscores with
\_
and just document it that if people want to use wildcards they need to use*
which we internally preprocess to a regular underscore before passing to SQL.Bit of a hack.
Done, under your responsibility :-)
Bloke wrote #337760:
Not ideal, but less work than splitting the filename on a delimiter and adding headers when the prefix changes.
These bits are actually easy:
<txp:if_different>
<txp:file_download_name breakby="-" limit="1" />
</txp:if_different>
Offline
Re: Ideas for emulating two file download categories?
Just so I understand correctly (I can’t easily test atm):
Two wild cards: %
and *
(as an alias for the SQL _
). Do those two cover the same, e.g all assets in the example above?
Question: is the -
delimiter required? Or is that just a convenience (it certainly does make for a readable category names in the example).
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Ideas for emulating two file download categories?
phiw13 wrote #337814:
Two wild cards:
%
and*
(as an alias for the SQL_
). Do those two cover the same, e.g all assets in the example above?
Yes, %
is for any number of characters, and *
matches one character, à la sql _
. The underscore _
itself acts as a literal character, since it can be part of category names, unlike %
and *
.
Question: is the
-
delimiter required? Or is that just a convenience (it certainly does make for a readable category names in the example).
Not required at all, but is one of rare characters allowed in category names that is readable as delimiter when you need to split a name.
Offline
Re: Ideas for emulating two file download categories?
etc wrote #337816:
Yes,
%
is for any number of characters, and*
matches one character, à la sql_
. The underscore_
itself acts as a literal character, since it can be part of category names, unlike%
and*
.
Thanks! I understand now. The is certainly a useful feature. And yes the -
as part of the category name makes for readable and thus easy to use names.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Ideas for emulating two file download categories?
We already use wildcards in cf queries, so there is nothing really disruptive here.
Offline