We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37060
    • 45 Posts
    Hi!

    I have a fairly simple contact form that I spent a half day with, trying to get it work. I made sure the email system was working properly, tested it with the form from wiki and uninstalled the Formit add-on three or four times. Then, I tested the form on a blank page and it worked. Next I started adding elements from the page that didn't work and this broke it: <base href="[[++site_url]]" />

    I suspect that this is the line that is failing:

    <form action="[[~[[*id]]]]" method="post" class="form" id="lomake">

    What does that *id with twenty brackets do precisely? How does declaring base href affect it?

    Also I have Babel installed and with that my web context's home directory isn't root but www.example.com/fi/. I suspect this might have something to do with it? I have .htaccess done according to this: http://designfromwithin.com/blog-webdesign-development/2012/01/12/modx-multilingual-setting-up-babel-and-have-a-website-with-multible-languages/

    Thanks!
      • 37060
      • 45 Posts
      Forum removed the code, they should look like this:

      <base href="[[++site_url]]" />
      
      and
      
      <form action="[[~[[*id]]]]" method="post" class="form" id="lomake">
        • 37060
        • 45 Posts
        Hm. More interesting stuff happening because of that base href. I'm using respond.js and media queries. IE7 and IE8 were not rendering the page correctly when resizing. Then just for the laughs I commented out the base href and now IE8 works fine.

        What is that thing and should it be changed when site_url is not the physical root of the server? Should I change .htaccess?
          • 19369
          • 1,098 Posts
          If you have Friendly URL active, yes. Here is an example of the .htaccess for a website that is not in the root (see line 2, website_folder_here):
          RewriteEngine On
          RewriteBase /website_folder_here/
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
            • 37060
            • 45 Posts
            Sorry, I was a bit unclear on that. The site is at the root, it just has two virtual subfolders for language contexts, /fi/ and /en/. They don't exist and all the requests to those folders are redirected to root in .htaccess.
              • 3749
              • 24,544 Posts
              Did you create a site_url Context Setting for each context?


              ------------------------------------------------------------------------------------------
              PLEASE, PLEASE specify the version of MODX you are using.
              MODX info for everyone: http://bobsguides.com/modx.html
                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
                • 37060
                • 45 Posts
                Yes. And contrary to my previous post, the Finnish (web) context has no subfolder defined in context settings, only /en/ does.

                Here are the settings for both contexts:

                web
                base_url: /
                cultureKey: fi
                site_start: 1
                site_url: http://www.mysite.com

                en
                base_url: /en/
                cultureKey: en
                site_start: 13
                site_url: http://www.mysite.com/en/


                  • 3749
                  • 24,544 Posts
                  See if you can preview the pages containing the form. If so, do a "view source" on them and see what the form action is. It should be the same as the URL of the page. If it's not, try to adjust the site_url setting for the context so that it is.

                  The following tag is (in theory) replaced by the URL of the current page:

                  [[~[[*id]]]]




                  ------------------------------------------------------------------------------------------
                  PLEASE, PLEASE specify the version of MODX you are using.
                  MODX info for everyone: http://bobsguides.com/modx.html
                    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
                    • 37060
                    • 45 Posts
                    Hmm. It is different and doesn't even make any sense. It looks like this: contact.html?id=
                    When it should be contact.html

                    Oh, and my ModX version is 2.2.1.
                      • 3749
                      • 24,544 Posts
                      If you have Friendly URLs turned on in System Settings, make sure there is an .htaccess (not ht.access) file in the root.

                      Or, better yet, turn friendly URLs off and make sure there *isn't* an .htaccess file in the root. That will tell you if the problem is with .htaccess rewrite rules.


                      ------------------------------------------------------------------------------------------
                      PLEASE, PLEASE specify the version of MODX you are using.
                      MODX info for everyone: http://bobsguides.com/modx.html
                        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