I have following situation:
My clients site displays various items respresented by posts. The menu allows two options to view these posts:
- First is "show all items of type X"
- Second is "show all items in location Y"
The challenge I currently face is, that the location-view should use a different layout than the type-view.
The posts are real estate items (house, lot, semi-detached, condo, ...) The locations are cities (vancouver, toronto, ...)
- View 1: Show me all houses, done via url "site.com/category/houses"
- View 2: Show me all items in Vancouver, via url "site.com/category/vancouver"
Currently both views work correctly, but the "vancouver" view should also include an map, which is not included in the first case.
So I need to find a way to determine the "mode" of the page (by location or by type) - my current approach is to test the URL, but this seems very very quick-n-dirty style.
What real solution can be used in these cases? I cannot simply use function "in_category()" since each post will have a category for type and location