Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #17240

    How can I best insert a Google Map in Sentence’ contact page?

    1) Can that be done on top of the page (like video/image via Slideshow Options in the dashboard)?

    2) Or does that have to be done using an iframe in the content? If this is the case, how can I have the Google Map below the contact form?

    Thanks and regards,

    Monique

    #94682

    1) No

    2) You need to modify the page template a bit. Open up includes/loop-page.php and replace following code:

    the_content(__('Read more  →','avia_framework'));

    //check if this is the contact form page, if so display the form
    $contact_page_id = avia_get_option('email_page');

    //wpml prepared
    if (function_exists('icl_object_id'))
    {
    $contact_page_id = icl_object_id($contact_page_id, 'page', true);
    }

    if(isset($post->ID) && $contact_page_id == $post->ID) get_template_part( 'includes/contact-form' );

    with:

    //check if this is the contact form page, if so display the form
    $contact_page_id = avia_get_option('email_page');

    //wpml prepared
    if (function_exists('icl_object_id'))
    {
    $contact_page_id = icl_object_id($contact_page_id, 'page', true);
    }

    if(isset($post->ID) && $contact_page_id == $post->ID) get_template_part( 'includes/contact-form' );

    the_content(__('Read more →','avia_framework'));

    #94683

    Thanks Dude,

    With this code the order of content and form are being swapped. And no content can be placed anymore before the form…

    On the contact page (for reference see development site at http://www.deroostct.nl/wordpress/contact-route/) my client wants (1) text, (2) contact form and (3) Google Maps; in that sequence.

    How can that be done?

    - Monique

    PS: how can I get an automatic email message when a post has been replied?

    #94684

    Unfortunately that’s not possible at the moment. You can use a contact form plugin like http://wordpress.org/extend/plugins/contact-form-7/ or Formidable. An alternative would be to hardcode the map into the template file but that’s not user friendly. In this case open up includes/loop-page.php and replace:

    if(isset($post->ID) && $contact_page_id == $post->ID) get_template_part( 'includes/contact-form' );

    with:

    if(isset($post->ID) && $contact_page_id == $post->ID) get_template_part( 'includes/contact-form' );

    if(isset($post->ID) && $contact_page_id == $post->ID) echo 'my map iframe code';

    and instead of “my map iframe code” insert your google maps iframe code.

    #94685

    Thanks Dude.

    I have just put in a map using Google iFrame code and made an anchor link to the form in the introduction text on top of the page. Easy and simple… Hope the customer will like that too.

    A question about the contact form. When visitors make a mistake in the form or don’t fill in all the required fields, I only see the wrong/missing fields indicated by color. There are no messages like: “Please enter your name.” and “Please enter a correct e-mail adress.” etc. That is not really an accessible way of communicating with your visitors. People who are colorblind don’t see these slight differences in color… :-(

    How can these messages be build in?

    - Monique

    #94686

    The contact form doesn’t support error messages at the moment. You can try to replace following code/line in js/avia.js:

    surroundingElement.attr("class","").addClass("error");

    with eg:

    surroundingElement.attr("class","").addClass("error");
    surroundingElement.prepend("<span class='error'>Please enter your email address</span>");

    but it’s not a perfect solution. I’ll ask Kriesi to look into it though. For now you can use contact form plugins like http://wordpress.org/extend/plugins/contact-form-7/ or Formidable Free

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Google map’ is closed to new replies.