We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36704
    • 131 Posts
    HI guys,

    Currently i am running MoDx 2.0.7 with 10 Diff. Context (multiple Domains).
    All of this websites has it own Contact Forms using with latest Formit 2.02 pl
    Here is my SMTP Settings for each context.


    On Formit:
    [[!FormIt?
    	&hooks=`math,spam,email,redirect`
    	&redirectTo=`407`
    	&emailTpl=`brebcorp-email-chunk`
    	&emailTo=`[email protected]`
    	&emailSubject=`Client Inquiry`
    	&validate=`name:required,contact:required,subject:required,message:required:stripTags`     
    ]]
    
    	[[!+fi.error.error_message:notempty=`<p>[[!+fi.error.error_message]]</p>`]]
            <form action="[[~[[*id]]]]" method="post" id="form1" class="form">
    		<fieldset><legend>Contact form</legend>
    		<h3>Online Inquiry</h3><br />   
    		<input type="hidden" name="nospam:blank" value="" />
    
    		<label for="name">  
    		Name:  
    		<span class="error">[[+fi.error.name]]</span>  
    		</label>  
    	       <input type="text" name="name" id="name" value="[[+fi.name]]" />
    
    	        <label for="contact">
    	       Contact No:
    	       <span class="error">[[+fi.error.contact]]</span>
    	       </label>  
    	       <input type="text" name="contact" id="contact" value="[[+fi.contact]]" />
    
    
    	       <label for="message">
    	        Your Concern:
    		<span class="error">[[+fi.error.text]]</span>
    	         </label>
    		<textarea name="message" id="text" cols="55" rows="20" value="[[+fi.text]]">[[+fi.text]]</textarea>
    		<br class="clear" />
    
    	        <label><h3>[[!+fi.op1]] [[!+fi.operator:is=`-`:then=`minus`:else=`plus`]] [[!+fi.op2]]?</h3>Please type below your answer (Use for Anti-spamming)</label>
    		[[!+fi.error.math]]
    		<input type="text" name="math:required" value="[[!+fi.math]]" />
    		<input type="hidden" name="op1" value="[[!+fi.op1]]" />
    		<input type="hidden" name="op2" value="[[!+fi.op2]]" />
    		<input type="hidden" name="operator" value="[[!+fi.operator]]" />
    		<br />
    
    		<br class="clear" />
    		<div class="form-buttons"
    		<p class="submit"><button type="submit"></button></p> 
    		</div>       	
              </form>  



    The only problem is my Formit is working properly for those 5 Context only but the rest was not.
    And now my question is:
    Is it possible that the Formit has a limitations for mutiple (context) websites?

    Have any one of you has experience with this?

    If you have any good suggestions and it will be a BiG BiG HELP for me and to others.


    Thanks


      • 28432
      • 372 Posts
      Hello,

      I got the same problem this morning after changing temporary URL to final URL and adding some different context.

      To solve it you need to check :

      $http_host => config.inc.php => in core/config/ folder. This have to match to the curent URL !!!
      all working context => site_url This have to match to the curent URL !!!

      I hope this help !
        • 3749
        • 24,544 Posts
        Be sure the base href tag in the head section of all your templates is called uncached (with the exclamation point):

        <base href="[[!++site_url]]" />
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 28432
          • 372 Posts
          Quote from: BobRay at May 30, 2016, 10:26 PM
          Be sure the base href tag in the head section of all your templates is called uncached (with the exclamation point):

          <base href="[[!++site_url]]">

          For me i got always this tag in the head... And got the same problem... with this tag !
          Now it resolved with checking this :

          $http_host => config.inc.php => in core/config/ folder. This have to match to the curent URL !!!
          all context => [[++site_url]]. This have to match to the curent URL !!!

          PS: include http, www if needed.
          • You should have site_url and base_url defined as a context setting for each context.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org