Copy link to clipboard
Copied
Hi,
I'm using the {module_subscriptions} tag to output a list of secure zones that a logged-in user is subscribed to.
However, I need to sort the list alphabetically by the name of the secure zones. At the moment, the list seems to be output in the order that the secure zones were created, rather than alphabetically by name.
There doesn't appear to a sorting option for this tag in the documentation. Does anyone know of a different way of going about this?
To give some context, the website we're using the {module_subscriptions} tag on sells yearly subscriptions to journals in PDF format, with 4 issues per year.
So, we could have several secure zones, each containing 4 PDFs uploaded and secured through BC's media downloads, e.g. called 'Journal A - 2015', 'Journal A - 2016', 'Journal B - 2015' and 'Journal B - 2016'.
If somebody was subscribed to all of these secure zones, the list needs to be displayed alphabetically, as follows:
Journal A - 2015
Journal A - 2016
Journal B - 2015
Journal B - 2016
rather than currently, which is the order in which they were created:
Journal A - 2015
Journal B - 2015
Journal A - 2016
Journal B - 2016
Thanks,
Richard.
You can use module_Data instead like..
{module_data resource="zonecustomers" version="v3" fields="customerId,zoneId,secureZone,customer" skip="0" limit="50" where="\{'customer.id':'LOGGEDINCUSTOMERID'\}" order="zoneId" collection="ZoneData"}
Changing the LOGGEDINCUSTOMERID to the actual id of logged in customer and changing the order= to what ever you need it to be.
Copy link to clipboard
Copied
You can use module_Data instead like..
{module_data resource="zonecustomers" version="v3" fields="customerId,zoneId,secureZone,customer" skip="0" limit="50" where="\{'customer.id':'LOGGEDINCUSTOMERID'\}" order="zoneId" collection="ZoneData"}
Changing the LOGGEDINCUSTOMERID to the actual id of logged in customer and changing the order= to what ever you need it to be.
Copy link to clipboard
Copied
Hi Liam,
Many thanks for the pointer towards module_data. It's not something I've used before, but I've now managed to produce the list of zones in the order I need, based on your information.
Thanks,
Richard.
Copy link to clipboard
Copied
Great stuff Richard, that is good to hear.