K
K
Kirill Gladikov2017-02-14 09:09:07
PHP
Kirill Gladikov, 2017-02-14 09:09:07

How to sort by city in MODX?

Hello.
I’ll make a reservation right away, I’m working with MODX for the first time, so I don’t know fashionable modules, as well as a lot in this CMF.
The crux of the matter . You need to make an accordion with addresses of stores sorted by city.
Example:
5f65048760ac469aa60330a15d7fa516.png
Clicking on a city opens a list of addresses.
As I understand it, to solve this problem, you need to make two tables
1. Cities
2. Addresses
And display table 2 sorted from table 1.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey L, 2017-02-23
@compudza

It's not entirely clear what the question is about MODs ...
If there are 2 levels and the content rarely changes, then you can create a two-dimensional array and take data from it.
If often, then again, depending on the number of cities and shops, you can have two tables, you can use one and select an array.
Accordion - should it open on reload or on hover? It’s more a question of how it is organized on the site, as an option, transfer the same array to JS.
PS: Asking the right question greatly improves the answer! ;)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question