We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1611
    • 591 Posts
    worchyld, I have the solution on that, I’ll post it today by evening, because I have to go work.
      • 1611
      • 591 Posts
      Okay. To get cross site links work you should use my version of multiLinks plugin:
      [php]
      global $modx;
      //$sitesIds = '3,2,8,85'; // You can specify root ID's here, or at the plugin configuration.
      $sites = $modx->getDocumentChildren(0,1,0,'id,pagetitle,alias',"sc.id IN ($sitesIds)");
      $out = &$modx->documentOutput;
      $current_host = $_SERVER[HTTP_HOST];
      
      foreach($sites as $site) {
      	if($site['pagetitle'] == $current_host){
      		$out = preg_replace("#/?".$site['alias']."/#i","/", $out);
      		$out = preg_replace("#/?".$site['alias']."\.html#i","index.html", $out);		
      	} else {
      		$out = preg_replace("#/?".$site['alias']."/#i","http://".$site['pagetitle']."/", $out);
      		$out = preg_replace("#/?".$site['alias']."\.html#i","http://".$site['pagetitle']."/index.html", $out);
      	}
      }
      [/php]

      Plugin configuration string:
      &sitesIds=Ids of SubSites (comma separated);string;3,2,8,85,169

      And hit «OnWebPagePrerender» event

      Note: this plugin will replace site prefixes with full domain name. But links on the current site will be like «/some.html»
        • 32645
        • 377 Posts
        I have another problem -- Google Sitemaps present the wrong url.

        It displays:


        http://www.somedomain.co.uk/somedomain-co-uk/test 2009-12-22 0.5 monthly

        This is wrong, it should be:


        http://www.somedomain.co.uk/test 2009-12-22 0.5 monthly

        Because somedomain-co-uk is a pointer for a domain. How do I get around this problem?
          • 32645
          • 377 Posts
          In the sitemap snippet, it uses:

          $url = '[(site_url)][~'.$doc['id'].'~]';
          


          This is where it puts in the folder and full hyperlink, however this is causing the sitemap (when used on custom domains) to be incorrect.

          How do I make it use the url?
            • 1611
            • 591 Posts
            May be it should be another event which plug-in is bound on. Not «OnWebPagePrerender». BTW, I hasn’t worked with Google Sitemaps.
              • 30741
              • 65 Posts
              A Very nice concept but I have a few issues -
              No matter what page I load all I get is a 404 error. Even if I manually type in http://www.siteb.local/index.html I still get a 404 error.
              Also the content in the general content folder, are not found.
              What am I doing wrong?
              IF I touch the link too - sitea.local my url looks like this: http://www.siteb.local/sitea-local.html
              So I am assuming I have done something wrong.
              Here is a copy of my htaccess.txt
                • 1611
                • 591 Posts
                RewriteRule ^(index\.(html?|php)|sited-local)?(.*)$ index.php?q=/sited/$3 [L,QSA]

                should be like
                RewriteRule ^(index\.(html?|php)|sited-local)?(.*)$ index.php?q=/sited-local/$3 [L,QSA]

                and of course DOMAIN TV and alias of sited Root shoud be also sited-local
                  • 30741
                  • 65 Posts
                  Great thanks.
                  Now onto wayfinder.
                    • 1611
                    • 591 Posts
                    Use [[UltimateParent]]
                      • 11278
                      • 9 Posts
                      OK huge problems. 404’s on everything accept index and my templates is broken on that page.

                      Here are the problems.
                      --Index will work less the template.
                      If you look at the template its trying to call /Stylesheets/content.htm etc (all stylesheets are content pages in a stylesheet folder or organization) which are called by a chuck in the header of template.

                      Parts of template still not working, and no images set to backgrounds work even after changing links.

                      --Also for the subfolders I use to organize content are making the links not function. Instead of calling page.htm (which by the way returns 404) it calls /folder/page.htm (which also returns 404) This page being in siteurl/folder/page.

                      Now when I goto say page.htm (which is located in url/home/page) it will return an error page @ url/page. If you goto url/urlalias/home/page you get the page itself but templates still not loading styles right.

                      I am not using wayfinder yet as I figured the site would work to some extent without it. Everything was done to spec on the tutorial less the wayfinder.

                      Also how am I suppose to point the domain. Do I change DNS and modify cpanel to accept it or do I point the domain to domain1.net/domain2.net ?
                      Pointing the DNS to sever and set up parked domain. When you goto this site though it returns the site down message. However if you goto url1/url2/index it shows it up (again stylesheets not loading right)

                      Site structure
                      stylesheets (all stylesheets are stored in modx content and linked via id in the templates from chunks)
                      -stylesheet1 etc

                      www.fubar.net (same structure for other sites)
                      -home (actually displays the index.htm normally)
                      --about (setup used in menu php for drop down)
                      --content etc (will link as /home/content.htm which will goto error page but fubar.net/fubar-net/home/content.htm works with style issues)

                      -join here (standard unpublished folder)
                      --join now (actual join page with links to membership pages)
                      ---membership (multiple membership folders used to organize content)
                      ----form
                      ----form2 etc
                      ---Cancel subscription (standard pages under join now for organization)
                      ---Join Again
                      ---my member info

                      -foobar departments (list departments using parent as filter)
                      --Departments (list courses using parent as filter)
                      ---Courses (holds video content associated with course)
                      ----video content


                      Modx info:
                      MODx version 0.9.6.1p2
                      Version codename rev 3281

                      Also I am using prefix .htm (modified the htaccess and multisite plugin to reflect this.

                      If I missed something or you want to see specific content let me know. Going to try and figure out why it wont work while waiting for suggestions.

                      Thanks


                      UPDATE:
                      added "# The Friendly URLs part for the rest (or the main domain)
                      RewriteCond %{REQUEST_FILENAME} !-f
                      RewriteCond %{REQUEST_FILENAME} !-d
                      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                      "
                      to the htaccess file and now every page (including the other domain) less the main domain index returns the standard error page without template of course (upgrade from 404 I guess but the other domain stopped trying to point to its index.htm)
                      Pages will return right content if linked via url/urlalias/alias etc but not url/alias. And only content, the stylesheets are not loading right and background images not at all.
                      the background images are working had to put a / in front of each entry for them.

                      Now I need to fix openx because it wont let me view the added site smiley