We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15073
    • 3 Posts
    Hey everyone!

    I’ll start with a little introduction. My name is Jurjen and I’m from the Netherlands (what explains why my English sometimes may be wrong). I recently installed MODx for the first time. Except from phpBB I never really used a CMS, but there’s a first time for everything. I pretty experienced with HTML and a just a little with PHP and javascript.

    Installing it went well and I got a template for it. I had no trouble at all with it, but some friends told me they didn’t see the pictures and the links didn’t work. Then I found out it only go’s wrong in IE. I use FireFox myself and with that browser everything just works fine.

    The problem:
    When using IE, the server doesn’t load the site url in the HTML.
    So a link in FireFox looks like this: http://www.domainname.com/index.php?id=1
    In IE the same link looks like this: http:///index.php?id=1

    The same goes for the addresses of the pictures (ie: the emoticons).

    I’m not yet that familiar with MODx. I already browsed through the php codes, but couldn’t find anything to solve it. Can you help me on this?

    Thanks!
      • 33372
      • 1,611 Posts
      Sounds to me as if you just need to add a base href tag to your template.
        "Things are not what they appear to be; nor are they otherwise." - Buddha

        "Well, gee, Buddha - that wasn't very helpful..." - ZAP

        Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
        • 22303 MODX Staff
        • 10,725 Posts
        Do you have
        <base href="[(site_url)]"></base>

        in the HEAD of your template before any elements with an href or src attribute? In particular, depending on the template and document type declarations, you need to make sure and use the full closing tag, and not the short closing tag form
        <base href="[(site_url)]" /> 

        which can trigger some nasty IE 6 bugs (not sure if these are resolved in IE 7 or not) when certain javascripts are executed.
          • 33372
          • 1,611 Posts
          JavaScript errors? That I didn’t know about. I knew that launching scripts from inside table cells sometimes causes IE6 to throw a rod, but I didn’t realize the short base tag could as well.

          The base href bug in IE6 that always drove me nuts was the one that keeps you from being able to select and copy text if you don’t use the full (<base href="..."></base>) version of the tag.

          IE7 doesn’t suffer from the text selection bug if you use the short tag, but since IE6 is still more popular and it doesn’t cost anything to add the closing </base> I always use the full version now.

            "Things are not what they appear to be; nor are they otherwise." - Buddha

            "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

            Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
            • 22303 MODX Staff
            • 10,725 Posts
            Yes, I discovered the bug when implementing the UFO (Unobtrusive Flash Objects) script from http://www.bobbyvandersluis.com/ufo/; here is the information from the FAQs on that page...
            Q How do I prevent Internet Explorer from crashing when a <base> tag is defined?
            A Including a closing </base> tag will prevent this bug in IE being triggered. For HTML 4 compliant pages (a closing BASE tag is forbidden under HTML 4), you could use IE conditional comments to keep your HTML valid and still include a closing BASE tag for HTML 4 documents: <base href="http://www.yourdomain.com/"><!--[if IE]></base><![endif]-->
              • 15073
              • 3 Posts
              Hey,

              I read the posts and checked the base-tag. In the template it said:
              <base href="[(base_url)]" />

              So I corrected it -as suggested- to:
              <base href="[(base_url)]"></base>

              But still, when I open the site with my browser, both FireFox as IE6 display in the HTML:
              <base href="/"></base>


              Any more suggestions?
                • 33372
                • 1,611 Posts
                That seems correct to me. Perhaps you should try using site_url. See this topic for more info:
                http://modxcms.com/forums/index.php/topic,2035.0.html
                  "Things are not what they appear to be; nor are they otherwise." - Buddha

                  "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

                  Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                  • 15073
                  • 3 Posts
                  Quote from: ZAP at Mar 20, 2007, 02:05 PM

                  That seems correct to me. Perhaps you should try using site_url. See this topic for more info:
                  http://modxcms.com/forums/index.php/topic,2035.0.html
                  Thanks!

                  I added two lines starting in l. 31 with the following codes:
                  $base_url=’http://<my domain>/’;
                  $site_url=’http://<my domain>/’;

                  Now, it works in IE6 too. Thanks everybody for your help!
                    • 22303 MODX Staff
                    • 10,725 Posts
                    Quote from: Jurjen at Mar 20, 2007, 02:31 PM

                    Quote from: ZAP at Mar 20, 2007, 02:05 PM

                    That seems correct to me. Perhaps you should try using site_url. See this topic for more info:
                    http://modxcms.com/forums/index.php/topic,2035.0.html
                    Thanks!

                    I added two lines starting in l. 31 with the following codes:
                    $base_url=’http://<my domain>/’;
                    $site_url=’http://<my domain>/’;

                    Now, it works in IE6 too. Thanks everybody for your help!

                    No, you don’t need to look at that thread -- that is out of date info -- just use [(site_url)] instead of [(base_url)] in the base href... base_url is a absolute URL from the root of the web server, while site_url includes the scheme and hostname as well. No modification to config.inc.php is required.
                      • 27376
                      • 576 Posts
                      I ran into a similar problem and documented it here: http://modxcms.com/forums/index.php/topic,12786.0.html

                      Different scenario, but same result. Perhaps automatically generating the site_url / base_url variables should be user defined instead? Or maybe allowing an override in the manager for special situations like these.