Shortcode to Manually Set Mashup Map Type

Home Forums MapPress Support Shortcode to Manually Set Mashup Map Type

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #13596
    billboardsavant
    Participant

    Hi All,

    I’m probably missing something obvious here, but can’t seem to manually set a mashup to display as a roadmap via shortcode (default map type in settings is hybrid). So far I’ve tried several parameters, but nothing works…

    [mashup query="post_type=port&mapTypeId=roadmap"]
    [mashup query="post_type=port" mapTypeId="roadmap"]
    [mashup query="post_type=port" maptypeid="roadmap"]
    [mashup query="post_type=port" maptype="roadmap"]

    Checked the documentation and forums, tried clearing cache, etc. Running MP Pro 2.40.7 without any other bugs or conflicts. Any thoughts?

    #13597
    Chris
    Keymaster

    Hi,

    The map type is a shortcode parameter (‘maptypeid’), not part of the query, so this one should work:
    [mashup query="post_type=port" maptypeid="roadmap"]

    However, it sounds like ‘roadmap’ has been removed from the ‘map types’ section on the settings screen? If so, the ‘maptypeid’ will be ignored. The setting isn’t a default type – it determines which types are allowed.

    #13599
    billboardsavant
    Participant

    Thank you, Chris. I enabled the roadmap type in general settings, and the problem was resolved.

    On a separate but related note, I’m now trying to create separate mashups by categories of portfolio items, but am unable to filter the query (all markers are showing instead of specific categories). For example, portfolio category #39 contains 4 posts and category #40 contains only 1, but all five markers are included in the mashup regardless of the shortcode used…

    [mashup query="post_type=port&category_in=39" maptypeid="roadmap"]
    [mashup query="post_type=port&category_in=40" maptypeid="roadmap"]
    [mashup query="category_in=39" maptypeid="roadmap"]
    [mashup query="category_in=40" maptypeid="roadmap"]

    Is there a limitation on querying categories of custom post types?

    #13600
    Chris
    Keymaster

    No, there’s no limitation. I think the problem is that the ‘in’ parameters in WordPress need *two* underscores.

    Try this (with the double underscore):
    [mashup query="post_type=port&category__in=40"]

    There are a few examples in the documentation, and here:
    http://codex.wordpress.org/Class_Reference/WP_Query

    #13601
    billboardsavant
    Participant

    I actually tried the markup above earlier (and retested to double-check), and it just returns a world map w/o markers. Fortunately, I took another look through the theme’s framework files, and came up with a working solution! Basically the portfolio is defined in an array as type => port and taxonomy => portcat, so by using the custom taxonomy parameter, I can now filter the custom post categories like so:

    [mashup query="portcat=johnstown" maptypeid="roadmap"]

    Thanks for working through this one, Chris. Hopefully someone else will benefit from my discovery 🙂

    #13602
    Chris
    Keymaster

    I’m glad you figured it out!

    Custom taxonomies (like ‘portcat’) don’t work with ‘category__in’ because it only applies to the standard ‘category’ taxonomy.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.