Suggestions on time saving entry

Home Forums MapPress Support Suggestions on time saving entry

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #12997
    huski
    Participant

    I have an existing directory of thousands of businesses. Right now I have been opening each one and manually clicking New Map, copying the street address from the second line of the text above, the POI is then created. Then I click on that POI and rename it with the Post Title, also give the POI the Post Title name, and then finally save it.

    Then when I save the post the map automatically shows up at the bottom, however I need it to be 100% width so it needs to be created first, then click ‘insert into post’ then manually change the shortcode, example:

    [mappress mapid=”220″]
    to
    [mappress width=”100%” mapid=”220″]

    I see in the documentation:

    The map width can be specified as a percentage in the map editor or the shortcode.

    I don’t see how the width can be specified as a percentage in the map editor, only pixels. Ideally is there away to default all maps have the extra width=”100%”?

    My second question, is there any suggestions on speeding the process up I mentioned in the first paragraph, of taking existing posts and pulling the post topic as the name of it’s map, and the second line of the post to be the map’s POI? Any suggestions appreciated.

    #12998
    Chris
    Keymaster

    Hi,

    There’s probably a few ways to speed things up.

    First of all, if you can store the address in a custom field (or fields) then you can configure MapPress to automatically generate a map when each post is saved/published using that field as the address. You might need to use a CSV importer or similar tool to re-import the posts if the address isn’t already split out into a field.

    Once the maps are created, rather than editing the marker title & body, just go to the MapPress settings and tell the plugin to display the post title for the title and the address for the body for mashups.

    If you want to change the display further, or want to display something other than the address when viewing a map for a single post, then you can edit the MapPress template files.

    Rather than inserting each map manually, you can just add a do_shortcode to your theme template file. You could also specify width there:

    In version 2.40.4 I also added a setting for the default map size as a %. I haven’t released that version yet but if you send me an email I’ll be happy to send you a copy.

    #12999
    huski
    Participant

    I created 2 custom fields, title and address, copy and pasting the info for each of those on existing posts, should be less time consuming, and does create an ‘automatic’ map but I think I need to email you for the new version because I need the width to be 100%.

    :::::::::::::::::::

    Mashup POI title
    Post title
    Mashup POI body
    Address

    Thats how I had these settings set, however they don’t seem to have an effect when changed to such as post excerpt (when experimenting creating new posts). Not sure if this even comes into play for what I described.

    I think the <?php do_shortcode(‘[mappress width=”100%”]’); ?> would be awesome but I didn’t have any luck putting it in the correct template file. I am using wordpress twenty twelve theme and not sure which template file or where to add that shortcode to. After many attempts thought would ask. With that being said, I may not need this if I have new version creating auto maps with 100 percent maps ??

    Thank you very much for your help.

    #13001
    Chris
    Keymaster

    Hi,

    I think you’ll find The template file you want is probably “single.php”. There may be some tutorials out there for the twenty twelve theme files, here’s one:

    http://www.class.giip.org/classes/wordpress/lesson-3/

    The mashup settings only apply to mashups. If you want to change the output behavior for single maps, you can modify the MapPress template file “map_poi.php” (see the documentation for an overview of copying/modifying the files).

    This should always print the post title as the title and the address as the body:

    <div class='mapp-iw'>
    	<div class='mapp-title'>
    		<?php 
    			if ($post = get_post($this->postid)) {
    				echo "<a href='" . get_permalink($this->postid) . "' $target>" . $post->post_title . "</a>";
    			}
    		?>
    	</div>
    	<div class='mapp-body'>
    		<?php echo $poi->get_thumbnail(array('class' => 'mapp-thumb')); ?>
    		<?php echo $poi->get_address(); ?>
    	</div>
    	<div class='mapp-links'>
    		<?php echo $poi->get_links(); ?>
    	</div>
    </div>
    #13005
    huski
    Participant

    I created a new map_poi.php with the code above and put it in my child theme directory, works perfectly !

    Thank you for sending me the new version, something is strange on the height output when trying to go for 100% x 100%. Maybe there is a trick to the settings on this, have included a screen capture of my settings (with percentages) and the right side of the screen shows a thin line that did go 100% width but doesn’t have any height.

    screen

    Thanks for suggestions.

    #13006
    huski
    Participant

    ok, I think I got it now, the settings for me should be 100% x 350

    Thank you very much, a great program, will learn more as I use it.

    #13007
    Chris
    Keymaster

    Hi,

    I’m glad you figured it out. It’s a CSS thing – when the browser is drawing the page, if the container element doesn’t have a fixed height (and blog pages usually don’t), then 100% height results in an actual size of 0 pixels.

    If you create a fixed-height or full-screen container element then 100% should work.

    Or just using a pixel height works fine, too.

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