VGM – some Form-Improvements

New home Forums Visitor Generated Markers General queries VGM – some Form-Improvements

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #58386
    janoschasen
    Participant

    Hey,
    we are currently using your amazing plugin to support small local business during corona-crisis.

    Laden finden

    As there are loads of people (who often have zero internet-experience) are adding Markers we experience some Problems with the “quality” of the entries. Some improvements would help greatly.

    1. Added URLs without http:/ or https:/ lead to 404-Pages within our WordPress as they are treated as links below the current site. Is there a possibility to leave the wordpress-context when http is detected inside the url? Or add a setting to the VGM-Module?

    2. People tend to write the wrong things / forget important information – e.g. the postal code in the Adress. I hacked some descriptions of what is expected via ::before-elements but having the option in the backend would be highly apprecieated (in coming updates maybe)

    3. People tend to write too much / too few information. Would it be possible to set maxlenght / minlength ?

    4. People forget even more stuiff – would it be possible to set required fields (e.g. category)

    Best regards, keep up the great work,
    Janosch

    #58391

    Hi Janosch,

    Thanks so much for getting in touch and for your kind words, it is truly appreciated.

    Regarding your questions:

    1. Leave the site context when HTTP is not detected in URL:
    This can be achieved by adding the custom code I have prepared below. Could I kindly ask if you could please navigate to Maps > Settings > Advanced Settings and please add this code and let me know if that helps? Thanks.

    2. Thanks and we will definitely look into adding this option in a future update

    3. Setting max length/min length for VGM description:
    This can be done with the JavaScript below as well, and once added, please let me know if that is correct.

    4. Setting required fields like category:
    This can also be done with the JavaScript below and will make the category field a required field.

    Here is the custom JS to add:

    jQuery(document).ready(function(){
    	jQuery('body').find('#wpgmza_category').attr('required', 'true');
    	jQuery('body').find('#wpgmza_ugm_add_desc').attr('maxlength', '50');
    	jQuery('body').find('#wpgmza_ugm_add_desc').attr('minlength', '10');
    	jQuery('body').on('click', 'a.wpgmza_infowindow_link', function(e){
    	    e.preventDefault();
    	    var url = jQuery(this).attr('href');
    	    if (url.indexOf('http') == -1){
    	        url = "http://" + url;
    	    }
    	    window.location.href = url;
    	});
    });

    I hope this helps and look forward to hearing back from you.

    Kindest regards,
    Dylan

    #58460
    janoschasen
    Participant

    Hi Dylan,
    the code you provided works like a charm and showed me the way to tweak the form to our needs.
    Thanks a lot.

    I changed the code for the link+http:/ behaviour a bit to open the linked site in a new tab – code below.

    jQuery(document).ready(function(){
    	jQuery('body').on('click', 'a.wpgmza_infowindow_link', function(e){
    	    e.preventDefault();
    	    var url = jQuery(this).attr('href');
    	    if (url.indexOf('http') == -1){
    	        url = "http://" + url;
    	    }
    	    var win = window.open(url, '_blank');
    	    win.focus();
    	});
    });

    Best,
    janosch

    #58469

    Hi Janosch,

    Thanks for letting me know and that is great to hear.

    Please let me know if there is ever anything else that I can assist you with.

    Thanks for your time.

    Kindest regards,
    Dylan

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