We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 349
    • 76 Posts
    Hi, i want to display a list of hotels, that are grouped by country and zipcode (PLZ-Bereich in german).
    I have two template variables assigned to the entries: country and zipcode.
    So first there should be a headline that reads "[[*country]], [[+first_digit_of_zipcode]]" and then repeat that with a delimitter when the first digit of the zipcode is different then the previous entry.
    Then the same should be repeated for every other country like in on the following site (made with typolight and the catalog module):
    http://www.regenata.de/hotelliste.html
    How do i do that?
    Can i sort entries by a TV with the getResources snippet?
      • 22303 MODX Staff
      • 10,725 Posts
      No; and TBH TV data is not intended for nor optimized for sorting thinks like this. This is again a case of where hotel data is not the same as presentation data represented by TVs and other MODx Elements. To do this properly IMO, the hotel data should be in a custom data model and then views can be constructed out of Resources and Template Variables (and other Elements) to present that data dynamically.