Quote

We're also available for Custom Joomla Development

Hire us now

Contact map - add more fields

Hi,I have install the Contact Map module, but I have questions about modification. How can i add four more fields after the phone number (mobile phone, mobile phone 1, email adress and coordinates + my custom icons for each field.
Can you help me please.
Thank you in advance.
       
  • Replied by admin on Monday, February 22 2016, 01:52 AM · Hide· #1
    Hi, it will need a quite alot of changes to the code but basically here are the basic changes you will need :
    Open file ../modules/mod_contactmap/tmpl/default.php

    around lines 281 before the code
    <?php if ($enable_anti_spam) :?>


    add this code :
    <div class="mphone1container">
                    <input type="text" class="input-small" name="rp_mphone1" value="" placeholder="Mobile Phone 1"/>
                </div>
                <div class="mphone2container">
                    <input type="text" class="input-small" name="rp_mphone2" value="" placeholder="Mobile Phone 2"/>
                </div>
                <div class="coordinatescontainer">
                    <input type="text" class="input-small" name="rp_coordinates" value="" placeholder="Coordinates"/>
                </div>


    end then at lines 149 before this code:
    // Check anti-spam, if incorrect returns error mesage */
        if ($enable_anti_spam) {


    add this code :

      $CORRECT_MPHONE1 = htmlentities($_POST["rp_mphone1"], ENT_COMPAT, "UTF-8");
        $CORRECT_MPHONE2 = htmlentities($_POST["rp_mphone2"], ENT_COMPAT, "UTF-8");
        $CORRECT_COORDINATES = htmlentities($_POST["rp_coordinates"], ENT_COMPAT, "UTF-8");


    and then modify the code at line 174 to become like this :
    $myMessage = 'You received a message from '. $_POST["rp_name"]." - ". $_POST["rp_email"] ."\n\n". $_POST["rp_message"]."\n\n". $_POST["rp_mphone1"] . $_POST["rp_mphone2"] . $_POST["rp_coordinates"];


    Have a try ;)
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by gdjuric981@gmail.com on Monday, February 22 2016, 07:04 AM · Hide· #2
    Thank you very much for fast response. I want make changes in "Extra Content", not in Contact form. Can you help me about Extra Content to add more fields after phone (mobile phone, mobile phone 2, email and coordinates) and if is it possible also to add my custom icons for each new field. Thanks
  •  
  • Replied by admin on Tuesday, February 23 2016, 12:59 AM · Hide· #3
    Hi I don't really understand about extra content you mean. Is it some thing that visitor will enter or you add in in the backend? Can you explain it a bit more detail?
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by gdjuric981@gmail.com on Tuesday, February 23 2016, 05:20 PM · Hide· #4
    Hi, they are three components in Contact map module layouts (map, form and extra). I want to add four more fields in backend extra content settings, after existing field phone (mobile phone, mobile phone 1, email and coordinates) and before twitter, facebook, google+ ... fields. Hope you understand me now ? Thanks
  •  
  •  
    Replied by admin on Wednesday, February 24 2016, 01:47 AM · Hide· #5
    Hi, Ok. Please followe steps :

    Open file ../modules/mod_contactmap/mod_contactmap
    at lines 245 after this code :
    <field name="skype"
            type="text"
            default=""
            label="MOD_CONTACTMAP_SKYPE_LABEL"
            description="MOD_CONTACTMAP_SKYPE_DESC" />


    add this code

    <field name="mphone1"
            type="text"
            default=""
            label="Mobile Phone 1" />
    
            <field name="mphone2"
            type="text"
            default=""
            label="Mobile Phone 2" />
    
            <field name="email2"
            type="text"
            default=""
            label="Email 2" />
    
            <field name="coordinates"
            type="text"
            default=""
            label="Coordinates" />


    then open this file
    ../modules/mod_contactmap/mod_contactmap.php

    at lines 46 after this code
    $skype 					= $params->get('skype');


    add this code
    $mphone1 					= $params->get('mphone1');
    $mphone2 					= $params->get('mphone2');
    $email2 					= $params->get('email2');
    $coordinates 					= $params->get('coordinates');


    then open this file
    ../modules/mod_contactmap/tmpl/default.php

    at lines 260 after this code
    <?php echo $s_address.$s_phone; ?>
                </ul>
            <?php endif; ?>


    add this code
     <img src="/path/to/your/icon"> <?php echo $mphone1; ?><br/>
            <img src="/path/to/your/icon"> <?php echo $mphone2; ?><br/>
            <img src="/path/to/your/icon"> <?php echo $email2; ?><br/>
            <img src="/path/to/your/icon"> <?php echo $coordinates; ?>


    Thant's all. You are now able to add the new extra info from the module backend
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
Your Response
Please login first in order for you to submit comments