Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use taxonomies other than 'category' #431

Closed
GoogleCodeExporter opened this issue Apr 4, 2015 · 28 comments
Closed

Use taxonomies other than 'category' #431

GoogleCodeExporter opened this issue Apr 4, 2015 · 28 comments

Comments

@GoogleCodeExporter
Copy link

It would be great to generalize the various category features of Geo Mashup to 
work with any taxonomy. This will be a big job, and help would be welcome.

Original issue reported on code.google.com by dylankk...@gmail.com on 18 Feb 2011 at 2:57

@GoogleCodeExporter
Copy link
Author

My current workaround for making maps for a specific taxonomy term is here:

http://snipplr.com/view/37962/geo-mashup-post-query-contextual-map/

Original comment by dylankk...@gmail.com on 14 Apr 2011 at 12:44

@GoogleCodeExporter
Copy link
Author

Issue 454 has been merged into this issue.

Original comment by dylankk...@gmail.com on 5 May 2011 at 4:10

@GoogleCodeExporter
Copy link
Author

Issue 456 has been merged into this issue.

Original comment by dylankk...@gmail.com on 5 May 2011 at 4:15

@GoogleCodeExporter
Copy link
Author

Issue 460 has been merged into this issue.

Original comment by dylankk...@gmail.com on 10 May 2011 at 10:01

@GoogleCodeExporter
Copy link
Author

Has there been any workaround/update for this?

Original comment by wide.aw...@gmail.com on 9 Feb 2012 at 9:15

@GoogleCodeExporter
Copy link
Author

I have some funding available to start working on a generic implementation 
soon. I'll post back as I make progress or need assistance. I'm excited to make 
this the basis for the next feature release.

In addition to the technique I posted above, I've also used specific taxonomy 
data in the same custom field data is used in this guide: 
http://wiki.geo-mashup.org/guides/custom-marker-depending-on-a-custom-field-valu
e

Original comment by dylankk...@gmail.com on 9 Feb 2012 at 2:18

  • Added labels: Milestone-1.5

@GoogleCodeExporter
Copy link
Author

I think I'm about 70% through the implementation of this, but just one sponsor 
so far. If anyone else is ready to give me a boost toward 1.5beta1 with this 
feature give me a holler!

Original comment by dylankk...@gmail.com on 14 Mar 2012 at 2:55

@GoogleCodeExporter
Copy link
Author

"If anyone else is ready to give me a boost toward 1.5beta1 with this feature 
give me a holler!"

I hear you. I am dead broke, but let me see if I can find someone to do it. How 
much money, do you think?

Original comment by wide.aw...@gmail.com on 14 Mar 2012 at 6:55

@GoogleCodeExporter
Copy link
Author

Is it something we can sponsor across a wider group and as per earlier 
comenthow much is required? Thanks Amanda

Original comment by a...@intriguing-networks.com on 14 Mar 2012 at 6:57

@GoogleCodeExporter
Copy link
Author

There's no set amount - I'm not insisting on making my usual rate for Geo 
Mashup work (or it wouldn't exist!;), just hoping for encouragement. It's also 
a way for me to gauge how interested people really are in a feature. It'll 
probably take around 35 hours total, and so far I have $300 committed. If you 
want to make a small donation and mention this issue #, I'll throw it in the 
pot. Thanks!

Original comment by dylankk...@gmail.com on 16 Mar 2012 at 5:30

@GoogleCodeExporter
Copy link
Author

That's great we will definitely make a contribution Thanks as ever Amanda

Original comment by a...@intriguing-networks.com on 16 Mar 2012 at 5:55

@GoogleCodeExporter
Copy link
Author

This is implemented in the 1.5-dev branch for template syntax only.  It uses 
tax_query parameter syntax like query_posts():

http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters

An example:

<?php echo GeoMashup::map( array(
    'map_content' => 'global',
    'tax_query' => array(
        array(
            'taxonomy' => 'post_tag',
            'field' => 'slug',
            'terms' => 'helpful',
        )
    )
) ); 
?>

Obviously that's not going to work for shortcodes. Does anyone listening need a 
shortcode syntax?


Original comment by dylankk...@gmail.com on 31 May 2012 at 3:54

  • Changed state: Implemented

@GoogleCodeExporter
Copy link
Author

Hi all,

First, great plugin and great work!
I am using it on a web of sounds, creating a global map with markers for all 
recordings. I have three types of taxonomies to clasified the sounds. With one 
dropdown per taxonomy, user filters the markers on the global map.
I have tried to use the code in this issue to create a global map with each 
taxonomy, but this doesn´t work for me. I only would like to know if that code 
only will be run with the complete 1.5 version of the plugin, isn´t it? (I am 
using 1.4.8 version of the plugin). Have you got any date to have complete the 
1.5 version?

Excuse me about my english. Thanks you!

Original comment by jose...@gmail.com on 10 Jun 2012 at 8:52

@GoogleCodeExporter
Copy link
Author

Yes, the example code will only work with 1.5. Right now you'd have to run the 
development code in the 1.5-dev branch in SVN to try it 
(http://code.google.com/p/wordpress-geo-mashup/source/browse/#svn%2Fbranches%2F1
.5-dev%2Fgeo-mashup). A beta download of 1.5 shouldn't be too far away, but 
it's a volunteer effort and not on a firm schedule.

Original comment by dylankk...@gmail.com on 11 Jun 2012 at 2:06

@GoogleCodeExporter
Copy link
Author

Thank you for your effort. It´s a great job!

Original comment by jose...@gmail.com on 16 Jun 2012 at 10:23

@GoogleCodeExporter
Copy link
Author

Thanks for adding this feature in, I made a custom post type called locations, 
with taxonomy states. I now want to change the marker icon to a different color 
depending on what state it is in, however, I had the 1.4.9 plugin installed, I 
made a backup of the folder, deactivated the plugin, downloaded the 1.5-dev 
trunk and replaced all the files, reupped it, activated it. I am trying to use 
the custom.js to change the markers depending on the state, but nothing is 
happening, and no markers are even being shown. Can anyone tell me a solution 
for this? Here is the code that is in the custom.js:

GeoMashup.addAction('objectIcon', function( properties, obj ) {
        if ( obj.categories.length == 0 ) {
            // When there are no categories - mm_20_uncategorised.png
            //obj.icon.image = properties.custom_url_path + '/images/mm_20_uncategorised.png';
            obj.icon.image = properties.template_url_path + '/images/thermal_marker.png';
            obj.icon.iconShadow = '';
            obj.icon.iconSize = [ 24, 24 ];
            obj.icon.iconAnchor = [ 12, 24 ];
            obj.icon.iconInfoWindowAnchor = [ 12, 1 ];
        } else if (obj.categories.length > 1 ) {
            // When there is more than one category - mm_20_mixed.png
            obj.icon.image = properties.template_url_path + '/images/thermal_marker.png';
            obj.icon.iconShadow = '';
            obj.icon.iconSize = [ 24, 24 ];
            obj.icon.iconAnchor = [ 12, 24 ];
            obj.icon.iconInfoWindowAnchor = [ 12, 1 ];

        }
});

and here is the code I put on the page template file (page-contact.php)

echo GeoMashup::map(array(
  'map_content' => 'global',
  'tax_query' => array(
    array(
      'taxonomy' => 'states',
      'field' => 'slug',
      'terms' => 'illinois',
    )
  )
));

The map shows up, but no markers are there. I am semi new to this too, so I 
think the custom.js configuration is really messing with me :(

Any help would be much appreciated.

Original comment by aolin...@gmail.com on 29 Jun 2012 at 4:29

@GoogleCodeExporter
Copy link
Author

Awesome - glad you have your help giving things a workout! I've see I've broken 
some backward compatibility - obj.categories is now obj.terms.category I think. 
Also see if you get markers with the geo mashup custom plugin deactivated to 
check that the taxonomy query is working.

Original comment by dylankk...@gmail.com on 29 Jun 2012 at 4:48

@GoogleCodeExporter
Copy link
Author

Okay, so I was a big dummy.. So heres what I did, I deleted the overwritten 
files I uploaded, deleted the plugin, zipped up the 1.5-dev trunk and just 
installed the plugin from that. Worked like a charm when I used:
echo GeoMashup::map(array(
   'map_content' => 'global',
     'tax_query' => array(
    array(
     'taxonomy' => 'facilities',
     'field' => 'slug',
     'terms' => array('agencies', 'branches', 'branchplants'),
    )
     )
));


I am going to mess with it more in terms of setting a different marker 
depending on the facilities, but basically in the custom.js, would we put the 
taxonomy ID number to search for in order to customize the marker? so roughly 
like this?

GeoMashup.addAction('objectIcon', function( properties, obj ) {
// if taxonomy term is 'agencies' -> 47
 if (obj.terms.category == 47 ) { 
   obj.icon.image = properties.template_url_path + '/images/agencies_marker.png';
   obj.icon.iconShadow = '';
   obj.icon.iconSize = [ 24, 24 ];
   obj.icon.iconAnchor = [ 12, 24 ];
   obj.icon.iconInfoWindowAnchor = [ 12, 1 ];
}

});

I am assuming that's how I do it?


Thanks for the speedy reply again Dylan! Let me know where I can send a 
donation!

Original comment by aolin...@gmail.com on 29 Jun 2012 at 5:22

@GoogleCodeExporter
Copy link
Author

Got it! Here's my result

if(obj.terms.facilities == 58){
  obj.icon.image = properties.template_url_path + '/images/mark-hq.png';    
  obj.icon.iconSize = [29, 33];
  obj.icon.iconAnchor = [10, 30];           
}

I also used this to debug the values as well. It may help out other people.

GeoMashup.addAction('objectIcon', function( properties, obj ) {
    alert(obj.toSource());

    /* my taxonomy was facilities so i added it after terms. If your taxonomy is shoes, you would put nike, puma, etc. */

    alert(obj.terms.facilities.toSource());

});

Original comment by aolin...@gmail.com on 29 Jun 2012 at 6:55

@GoogleCodeExporter
Copy link
Author

Awesome! As a note for others, obj.terms.facilities == 58 is a shortcut. The 
value is really [ 58 ], and if the object had multiple facilities it might be [ 
58, 62, 70 ], and obj.terms.facilities == 58 would be false.

The toSource() method is not available in all browsers, but most browsers these 
days have developer tools (install Firebug in Firefox) that will let you look 
at variable values and lots more.

Thanks for any and all contributions!
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=11045324

Original comment by dylankk...@gmail.com on 30 Jun 2012 at 1:11

@GoogleCodeExporter
Copy link
Author

Issue 170 has been merged into this issue.

Original comment by dylankk...@gmail.com on 30 Jun 2012 at 1:40

@GoogleCodeExporter
Copy link
Author

I'm very excited for the stable release of 1.5. I'm curious as to whether this 
functionality will work in shortcode? If not, that's fine as I have no problem 
using the php tag. I'm most interested in whether this might tie into the 
Tagged Category Index feature? The ideal situation would be have clickable tabs 
that will have different city names and then pop up the rental properties that 
are associated with that city.

Thanks!

Original comment by rutgerb...@gmail.com on 5 Jul 2012 at 5:31

@GoogleCodeExporter
Copy link
Author

@rutgerboll, I think I'll roll it out without shortcode syntax, at least to 
start. The tabbed control will be [geo_mashup_tabbed_term_legend], and should 
work for your case using an hierarchical taxonomy.

Original comment by dylankk...@gmail.com on 11 Jul 2012 at 12:34

@GoogleCodeExporter
Copy link
Author

Hi, 

thanks for your plugin - so far its the best geo-plugin I could find with a lot 
of customisation-options.

I tryed out your code with the 1.5-dev branch in SVN and it crashed my blog, so 
I turned back to Version 1.4.9. When do you think you will have implemented the 
custom taxonomies and the term legend? Would really help to bring some order in 
my posts. 
Thanks

Original comment by berufebi...@gmail.com on 11 Jul 2012 at 7:41

@GoogleCodeExporter
Copy link
Author

Issue 596 has been merged into this issue.

Original comment by dylankk...@gmail.com on 31 Aug 2012 at 4:43

@GoogleCodeExporter
Copy link
Author

Issue 596 has been merged into this issue.

Original comment by dylankk...@gmail.com on 31 Aug 2012 at 6:12

@GoogleCodeExporter
Copy link
Author

Issue 596 has been merged into this issue.

Original comment by dylankk...@gmail.com on 31 Aug 2012 at 7:40

@GoogleCodeExporter
Copy link
Author

Original comment by dylankk...@gmail.com on 12 Apr 2013 at 5:12

  • Changed state: Released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant