We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36551
    • 416 Posts
    I can't figure out why Wayfinder links across contexts are not working.

    Get resources and Wayfinder are generating content across links. The wayfinder links to the second context are properly constructed but end up at the main domain error page.

    I've setup the contexts using Context Router following the tutorial here: http://cmstricks.com/blog/2013/05/10/contextrouter-review?ref=MODXForum

    I have a second domain parked at the root of the main domain.

    My context settings are as follows:

    Main context
    base_url: http://tbdsandbox.com/
    http_host: http://tbdsandbox.com/
    site_url: http://tbdsandbox.com/
    link_tag-scheme: full
    error_page: 5

    Second context
    base_url: http://svaroopa.info/
    http_host: http://svaroopa.info/
    site_url: http://svaroopa.info/
    link_tag-scheme: full
    error_page: 6
    site_start: 2

    I'm using a single template for all pages in both contexts.
    <base href="[[!++site_url]]" /> is in the head

    Friendly URLs are working correctly

    Wayfinder call is:
    [[!Wayfinder? &startId=`0` &scheme=`full` &contexts=`web,svaroopa` ]]

    ContextRoute is enabled with following system events checked:

    OnContextRemove
    OnContextSave
    OnHandleRequest
    OnSiteRefresh

    There are no errors in the Modx error log

    Modx 2.4.0
    PHP 5.4.43

    This question has been answered by benmarte. See the first response.

      • 3109 ☆ A M B ☆
      • 894 Posts
      I'm not sure what you are trying to do but take a look at Wayfinder &contexts and &startIdContext parameters.

      I'm not clear if Wayfinder is the issue or the error page, can you clarify. Also make sure your first context has a site start value. [ed. note: benmarte last edited this post 11 years, 1 month ago.]
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 36551
        • 416 Posts
        Ben

        Thanks for taking a look at this.

        I'm trying to get pages from the second context to display. If I navigate directly to svaroopa.info in my browser, it displays svaroopa.info as the URL but it displays doc 1, the home page of the main context.

        If I go to any other url in the second context, via wayfinder, link or typing in the url directly, it displays the URL of the page I want to go to but, displays doc 5, the error page in the main context.

        So I would say it's not a wayfinder or error page issue. It seems to me the context routing is not working.

        As for the &contexts and &startIdContext parameters, there's no explanation of them in rtfm. I've gleaned usage from forum discussions.
        • discuss.answer
          • 3109 ☆ A M B ☆
          • 894 Posts
          Did you add the site_start key to your first context? Make sure you add it to rule it out as the culprit.
            Benjamin Marte
            Interactive Media Developer
            Follow Me on Twitter | Visit my site | Learn MODX
            • 36551
            • 416 Posts
            Ben

            Yes, I did add the site_url to the main context. No change.

            I can provide a login to look around on this one.
              • 36551
              • 416 Posts
              Thanks to Ben, this is working.

              For others setting this up, it seems that the site url is the only entry that should have http:// the others only need www.domainname.com

              Thanks Ben!
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                  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
                  • 36551
                  • 416 Posts
                  Now I need to get images in TinyMCE to work across contexts.

                  When editing a document in the second context:

                  I can navigate to and select an image to insert into TinyMCE.
                  The images do not appear in TinyMCE dialog box when I click OK.
                  When I look at the image link, after saving, it includes the domain of the second context.

                  Here are my context settings:

                  Main context (.org)

                  base_url: svaroopa.org
                  http_host: svaroopa.org
                  site_url: http://svaroopa.org
                  link_tag-scheme: full
                  site_start: 1

                  Second context (.info)

                  base_url: svaroopa.info
                  http_host: svaroopa.info
                  site_url: http://svaroopa.info
                  link_tag-scheme: full
                  site_start: 1064

                  filemanager_path: /home/svaroop1234/public_html/
                  filemanager_path_relative: no
                  filemanager_url: svaroopa.org/
                  tiny.base_url: fullpath

                  This is the image link on the front-end, which fails to load.

                  <img src="svaroopa.info/assets/images/filename.jpg">

                  In the Firebug console I see this error (domain is in twice) for the same image.

                  NetworkError: 404 Not Found - http://svaroopa.info/svaroopa.info/assets/images/filename.jpg"

                  Are the key names correct?
                  Am I using the right keys?
                  Any additional keys I should use?
                  Are the values for the keys correct?

                  Any help would be greatly appreciated.
                    • 36551
                    • 416 Posts
                    Still trying to troubleshoot this.

                    I decided to display the context settings on the page I'm trying to add images to. They all display the values I've put in the context settings except for one.

                    [[++filemanager_url]]

                    I've cleared the cache numerous times. This value always comes back blank. If this setting is not being recognized could it be why this isn't working?
                      • 36551
                      • 416 Posts
                      Now I just noticed images inserted with TinyMce in the PRIMARY context do not display in the editor and the link to the image on the front-end is the full path.

                      Is it possible for the filemanager_path_relative setting in the second context is affecting the first context?