graphxks VIP
Total posts: 68
18 Jun 2014 20:23

The site I am developing has 47 Attraction categories. There are potentially thousands of Asset Locations, each of which fit into ONE category. (restaurants, hotels, etc.)

The Attraction category type contains the category name, description, and a category icon.

Screen Shot 2014-06-18 at 4.18.27 PM

I've created Parent/Child relationships between the Attraction/Asset Locations which works fine for sorting them. What I need now is for the Google Map icon of the Asset Location to automatically select the icon from the category, instead of being entered when the Asset Location Geo field is defined.

Thoughts?

Last Modified: 02 Jul 2014


Sergey
Total posts: 13,748
20 Jun 2014 03:01

For that you have to make copy of map template and hack it. Change marker image URL from one used to this one based on parent field value.


graphxks VIP
Total posts: 68
22 Jun 2014 15:37

Thank you Sergey, I will try that.


graphxks VIP
Total posts: 68
24 Jun 2014 15:05

Would that be the file com_cobalt/fields/geo/tmpl/output/default.php ?


Sergey
Total posts: 13,748
25 Jun 2014 01:44

Ok, I am sorry after investication I found out that it is not possible to do on the level of template. Since markers are displaied with AJAX request, that code have to be altered. it is a method onGetMarkersList in geo field.


Sergey
Total posts: 13,748
25 Jun 2014 23:17

What is the type of icon field?


Sergey
Total posts: 13,748
26 Jun 2014 11:39

And how many atraction may be connected to the article?


Sergey
Total posts: 13,748
26 Jun 2014 23:18

This is not really easy task. I could do image field which is part of the same type or article. But image field of even different article type is complicated. I am not sure it is possible to add to this field.

Only custom developemnt but that will hack geo field and you will not be able to update this field anymore.


pepperstreet VIP
Total posts: 3,837
27 Jun 2014 01:10

Sergey I could do image field which is part of the same type or article

Yes, please! (related topic and further ideas) ;-)


graphxks VIP
Total posts: 68
27 Jun 2014 02:41

Ok, I suppose the client will just have to retrain the editors to pick the icon in addition to the Category. No biggie, thanks for looking into it!


Sergey
Total posts: 13,748
27 Jun 2014 13:45

If that is done by admin yu can simply add custom geo field markers. Create new folder in markers folder in geo field and put there all pictures. Then select this folder in geo field parameters as marker source.

You wil be able even to filter by markers later.


graphxks VIP
Total posts: 68
27 Jun 2014 20:43

The client specifically wants the asset to get it's map market from the associated Attraction category (each asset belongs to one Attraction category).


Sergey
Total posts: 13,748
29 Jun 2014 13:19

This means what? That you need it?

I cannot think of a way to solve it. May be javascript? When attraction is chosen, it makes AJAX query add marker? I am not sure.


graphxks VIP
Total posts: 68
30 Jun 2014 18:57

I'm not sure either. They are doing it on their current system (.net custom) and want it on the new Joomla based system that is replacing it.

I don't want to take up too much of your time with it though so I may have to go through the AJAX code with them and hack up something.


Sergey
Total posts: 13,748
01 Jul 2014 00:37

graphxks I may have to go through the AJAX code with them and hack up something.

This is the problem. This solution only through hack. ANd the only place where you can hack is the onGetMarkersList method of geo field.


graphxks VIP
Total posts: 68
01 Jul 2014 02:41

A hack is acceptible. I realize we will have to reapply the hack after every Cobalt upgrade to Geo.


Sergey
Total posts: 13,748
01 Jul 2014 23:56

graphxks I realize we will have to reapply the hack after every Cobalt upgrade to Geo.

That is why. And I have no thoughts what I can do to avoid it.


graphxks VIP
Total posts: 68
02 Jul 2014 14:31

As I said, a hack is fine. The customer has the ability to reapply the hack after upgrades.

Powered by Cobalt