3

I want to build a directory of fishing ports It will have approx 500 entries, each geocoded for map display. I will have 4 views; 1) Directory with map of entries 2) Country and entries 3) Cities (Ports) and entries 4) Port entry

Issues I have at this stage.

a) how to structure countries,cities and fishing ports? admin will struggle to find stuff to edit if they have to page thru 500 entries when entries have similar names "Stella maris centre" exists in Netherlands and Australia, denmark etc. How can an admin distinguish the correct entry to edit? This assumes I am using categories for country and city storage.

b) I want the url structure to be "directory/country/city/fishing-port-name" Assuming I can use custom routes with categories to create my urls, i run into the issue above in a)

So should i create entry types for countries and cities and use them in heirarchy so admin can enjoy ease of finding stuff?

Planning around this is becoming a head spinner :)

1

a) There are a definitely a few ways to handle this, but I would recommend the following. Put your Countries and Cities in a category group, nesting cities inside countries. Your Fishing Port section should be a Structure, since the entries are not time dependent like entries in a Channel. All you would need is a single category field that relates the fishing port to a city.

b) This can be done with custom routes, as long as each Fishing Port entry is related to one city category.

As for organizing the entries in the admin, you can make use of the modify entry sortable attributes and the modify entry table attributes hooks, which allow you to add an attribute in the sort dropdown and add different columns to the entry view. With this, you can add a City and Country column to the structure listing.

3
  • Aaron thank you - this sounds like the way forward - hooking into admin display sounds totally doable too. Phew! [Coming from another CMS for the last 5 yrs I was starting to have my doubts]
    – joomkit
    Sep 29 '15 at 19:26
  • On the custom routing - I haven't looked into this deeply but in this scenario does it mean I'll need regX / dynamic routes or need to specify them in routes config?
    – joomkit
    Sep 29 '15 at 19:36
  • 1
    @joomkit setting them up with Regular Expressions in the routes.php config is better, as you can use the same "token" (named capture group) multiple times and allows to make capture groups optional. Something like this should be close to what you need: 'dir/(?P<country>[^/]+)(/(?P<city>[^/]+))?(/(?P<slug>[^/]+))?'.
    – carlcs
    Sep 30 '15 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.