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

    I configured wayfinder to display some weblinks and set &useWeblinkUrl=`0` because I wanted it to use the actual resource alias and not the weblink URL. Though, no matter if I use '0' or '1' it still shows the direct Weblink URL and not my alias. Is there anyway to get around that? For example, right now it shows:

    domain.com/path/to/file.zip

    I would like it to show:

    domain.com/category/resource-alias.zip and then simply send the user to the weblink from that. Is that not possible?

    Thanks!
      • 40045
      • 534 Posts
      try to use

      &useWeblinkUrl=`false`
      


      for me it works like that!
        • 37596
        • 18 Posts
        Thanks, that did seem to work to get the correct links. Strangely enough, it gives me a 404 error now instead of the actual web link file :S

        Because the web link points to a zip file, I created a Zip content type and created the weblink with the following settings:

        Resource Alias: file-name
        Content Type: Zip
        Content Disposition: Attachment

        So, it shows this:

        domain.com/category/file-name.zip

        Clicking on that generates a 404 error.

        I tried switched it to:

        Resource Alias: file-name
        Content Type: HTML
        Content Disposition: Inline

        Though with the same result.

        Not sure where to go from here, any suggestions? Thanks!
          • 40045
          • 534 Posts
          Just tried that on a site where I also use weblinks like you do (just pointing to sites, not to files, changed that for testing), I have a nav item which points usually to facebook (URL of companys facebook page) and is shown as /facebook.html on the website, but "behind" it is the real url...

          so to test your scenario I just replaced the link from the facebook page with one that's pointing to a .zip file in the filesystem and with nothing else changed (template = normal template I use for every page, doesn't matter because it's a redirect to somewhere, content type = HTML (btw. where did you find the content type ZIP??), content-disposition = inline, weblink = http://www.domain.tld/path/to/zip/file.zip) it just worked and gives me the download dialogue I'd expect...I'm on 2.2.6, but don't think that should matter...
            • 37596
            • 18 Posts
            I had created the zip content type myself via System -> Content Types. Though, guess it doesn't really matter if I have it set to HTML as long as it prompts to download.

            So, I went in and adjusted it to the following again:

            Content Type: HTML
            Content Disposition: Inline
            Weblink: http://domain.com/path/to/file.zip
            Response Code: HTTP/1.1 301 Moved Permanently

            Yet still seems to give me a 404 error. I created a new Weblink, left all settings as default, set the resource alias and the weblink URL, and still getting a 404. I'm a bit lost as to what it could be if it's working fine for you :S


              • 28042 ☆ A M B ☆
              • 24,524 Posts
              You should try using static resources. Create a proper content type for zip files (application/zip, binary), and have the path for the static resource be the path to the zip file. The resource settings should be

              Resource Type: Static Resource
              Content Type: Zip
              Content Disposition: Attachment

              Clicking on a link to such a resource will cause the usual download dialog to open instead of loading a page.
                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
                • 37596
                • 18 Posts
                Thanks for the suggestion Susan, I tried that but still no luck. This is what I have set.

                Content Type:

                Zip
                Zip Archive
                application/zip
                .zip
                Binary: yes

                Document:

                Static Resource
                Content Type: Zip
                Content Disposition: Attachment

                Sends me the 404 page. sad Though, what I did notice is that it does work correctly if i view the resource from within Manager, just not from the front end, perhaps the Friendly URL's are somehow causing an issue?
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Are you sure the resource is published? And the path of the static resource is the correct path to the file?

                  assets/files/myfile.zip
                    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
                    • 40045
                    • 534 Posts
                    Is the file accessible when you just put in http://domain.com/path/to/file.zip in your browser urlbar ie does it give you the download dialogue?
                      • 37596
                      • 18 Posts
                      I can access the file directly fine, so I know the path is correct. When set as a Weblink and using the weblink URL it does download fine on the frontend. I updated it to the correct path when I changed it to a Static Resource as well. I've tested /path/to/file.zip and it works fine, though /resource-alias.zip just sends me to the 404 page. The resource is indeed published. When I View Resource from Manager it sends me the resource alias name.....so resource-alias.zip, just not sure why it won't do the same on the front end. I have another modx install on a separate domain, so I may try a test resource there to see if the same issue exists.