0

Recently I have received a response from our wordpress coder regarding the issue.

  1. We have a map in content area which shows number of entities in each district. Then we have search form widget in sidebar area. We wanted these two to cooperate. If I change something in search form and press Search -> the map would dynamically respond and vice versa. Vice versa = if i pick the district, this district would be changed in sidebar's form element. We were told this isn't possible as of now.

  2. on other subpage we have in main content area results of search (companies, addresses, etc.) In sidebar, we planned to have a minimap showing location of these search results. Coder claims that sidebar's content aka widget of minimap has no way to find out what the results and addresses are.

Is this true? Is there really such obstacle, and no way to bypass it? (besides javascript)

EDIT: This might look suboptimal, indeed but the map is not universal feature. We are counting with some users having problems so it would be graphical (in the end) that you can use THIS OR THIS.. work version: https://i.sstatic.net/9bIl2.png Those dots on map districts should have been updated as someone picks main district, subdisctrict, vyrobca (manufacturer). It was all a pyramid and if specific manufacturer was picked the dots should have shown only number of companies from the database that include tag of the manufacturer. Also, we were told it's not possible. He could do only district-> subdiscrit filtering, not more.

I understand our budget wasn't high, only $3500 :( Maybe that's the problem.

4
  • 2
    sure it's possible to build something that works that way, but it's entirely possible that the way they've presently built it would require a rewrite. it's unanswerable without knowing the specifics of how the whole thing works.
    – Milo
    Commented May 15, 2014 at 20:10
  • Yeah, I feel the developer is not what he made us believe he was. He should have been a planner - planning ahead. We requested such feature and from start he said he thinks it's not possible. I never heard something is impossible within wordpress - only that it is badly scalable. :) Commented May 15, 2014 at 20:13
  • It's kind of sort of possible but not in a clean, robust and reliable way. E.g. if you rely on the current post, which post content should it pull from if the widget is in a post listing or an author archive? Which search result should it map to? What if the widget appears on a 404 page? What if a query has been made since the content was displayed? What seems like a simple request is anything but, and in most scenarios your coder is correct
    – Tom J Nowell
    Commented May 15, 2014 at 21:31
  • Tom, if the widget is in a post listing or on author archive it should be notified of that and it wouldn't interact with anything on the "content" side. It's a strange design, indeed. I might reconsider it. Commented May 16, 2014 at 4:44

1 Answer 1

1

We have a map in content area which shows number of entities in each district. Then we have search form widget in sidebar area. We wanted these two to cooperate. If I change something in search form and press Search -> the map would dynamically respond and vice versa. Vice versa = if i pick the district, this district would be changed in sidebar's form element. We were told this isn't possible as of now.

While I consider this poor design ( why have 2 district options? Two ways of browsing the same map in unrelated sections of the page?), your problem here is the districts, how does the search widget know what districts were in the posts content?

on other subpage we have in main content area results of search (companies, addresses, etc.) In sidebar, we planned to have a minimap showing location of these search results. Coder claims that sidebar's content aka widget of minimap has no way to find out what the results and addresses are.

The same problem again.

So this is how you would do it, and why it's not reliable.

Firstly, those posts/post content was pulled in via the main query.

So what the minimap would do here is look up the main query using the PHP globals $wp_query, grab the post from its member variables ( it's a WP_Query object), and look up the map data. This is not a beginner level task and is beyond the most WordPress coders ability/knowledge.

This will not work if:

  • any calls to query_posts were made, as the main query has been swapped out, you will get different data
  • Multiple posts were found rather than 1, leading to a new problem 'which post?'
  • No posts were found
  • The page does not have a post ( e.g. buddypress views )
  • Any of the widgets that preceded the search/map widget cleared up the post globals

My opinion on the whole matter is that your coder honestly does not know this, or if they know about it, they know how fiddly and unreliable it can be. I also think that what you're describing is sub-optimal, and if you were my client, I would counsel against implementing this purely from a user interaction point of view, and would suggest looking for better ways of doing it.

The idea of having multiple methods of selecting a district all on screen at once is confusing, and what you ask for is fiddly to implement and would be fiddly to use

3
  • 1. There are two district options - Main District, Sub district 2. hi Tom, thanks, I made edit to my post with some clarifying information. It's all about testing what would work for our users. The map just doesn't work well on ipad devices and I wish we could gather budget to have that implented to show up well on devices as well. Commented May 16, 2014 at 4:41
  • 3. My wild imagination created a hypothesis this can be done well only if the sidebar is not sidebar but graphical element in content template. Just another vertical column so they both share the same "logic". That was actually a first thing I thought of after i was told about this (of course almost at the end of project!) Why he didnt plan it this way=/, i don't know. I do not care about technicality of sidebars and main contents. It does not have to be SIDEBAR per se on the main page. Commented May 16, 2014 at 4:51
  • You can't claim this is not about the technical challenges, because that is why your coder is saying no. if you wanted a purely non-technical answer however then this question would be closed as subjective, this site is about WordPress development, not WordPress design
    – Tom J Nowell
    Commented May 16, 2014 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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