We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37380
    • 20 Posts
    Having issues with link_tag_scheme

    If you have any idea, please help at this thread:
    http://forums.modx.com/thread/30456/changing-the-default-link-scheme-the-end-of?page=2#dis-post-431516

    Thanks smiley
      • 43025
      • 4 Posts
      Quote from: opengeek at Nov 03, 2011, 05:25 PM
      Hmmm, I see the problem. I don't think the Contexts as subfolder technique will work at the moment without explicitly setting the site_url for each Context. You might enter a ticket for this as an improvement.

      I had the same problem and I applied this patch:

      FILE: core/model/modx/modcachemanager.class.php
      LINE: 52

                  /* generate the ContextSettings */
                  $results['config']= array();
                  if ($settings= $obj->getMany('ContextSettings')) {
                      foreach ($settings as $setting) {
                      	
                          $k= $setting->get('key');
                          $v= $setting->get('value');
                          
                          // Pacth
                          if ($k == 'site_url')
                          {
                          	// Replace domain for current domain
                          	$url_parsed = parse_url($v);
                          	$v = str_replace($url_parsed['host'], MODX_HTTP_HOST, $v);
                          }
      


      I use subfolders for languages too and [[site_url]] tag is used all over the code so it is very difficult to me to find and change the code/chunks.
      With this patch I change the value before it is generated in cache.
      This works fine for me. I jnow it is not elegant solution but it is the most fast solution I found.