• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Sorting the output of {module_subscriptions}

Community Beginner ,
Jul 20, 2016 Jul 20, 2016

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.

TOPICS
Content management and modules , Web apps

Views

413

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jul 20, 2016 Jul 20, 2016

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.

Votes

Translate

Translate
LEGEND ,
Jul 20, 2016 Jul 20, 2016

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 21, 2016 Jul 21, 2016

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 21, 2016 Jul 21, 2016

Copy link to clipboard

Copied

LATEST

Great stuff Richard, that is good to hear.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines