We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10208 ☆ A M B ☆
    • 1,780 Posts

    WORKS: assets/images/imageName.jpg

    DOESN'T WORK: /assets/images/imageName.jpg

    Which would be fine, as long as I remember not to include the /. But since snippets like BookmarkThis outputs the /assets/images/imageName.jpg path, no images display.

    Having spent a few hours looking for the solution to this without any success, please tell me where in the heck I can fix this so either works, or stop snippets from generating the / in image paths.

    Thank you
      Frogabog- MODX Websites in Portland Oregon
      "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
      Having server issues? These guys have MODX Hosting perfected - SkyToaster
      • 10208 ☆ A M B ☆
      • 1,780 Posts
      Bump - Any ideas? I've looked through every file in the BookmarkThis snippet/component and every site setting available, yet remain stumped.
        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 3749
        • 24,544 Posts
        This always confuses me, so don't consider me an expert, but if you have a media source defined, try removing the leading slash in its path (if it works, be sure to check for side effects).


        ------------------------------------------------------------------------------------------
        PLEASE, PLEASE specify the version of MODX you are using.
        MODX info for everyone: http://bobsguides.com/modx.html
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 9207 ☆ A M B ☆
          • 2,475 Posts
          Is your MODX installation in a subfolder? e.g. site.com/modx/ where using a leading slash would wreck the URLs?

          Are the images broken in the manager or on the front-end (or both)? I usually use a base tag in my HTML templates, e.g.

          <base href="[[++site_url]]" />


          And that helps keep urls from breaking when Apache rewrite rules are going on.
            • 10208 ☆ A M B ☆
            • 1,780 Posts
            Yes, this particular site is in a subfolder.

            There is no specific media source defined in the manager, and I do have the "base href=++site_url " code exactly as noted by Everett in the document head for all pages.

            At the moment, only the image paths produced by BookmarkThis are broken and that's because these paths include the preceding /. Removing the / in firebug pops the images right up.

            Images inserted via manager image browser and hard coded images are fine, although I can't use the /.

            site_url placeholder works as expected, no preceding / needed
            i.e.
            <link rel="stylesheet" href="[[++site_url]]assets/templates/siteTemplate/style.css">


              Frogabog- MODX Websites in Portland Oregon
              "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
              Having server issues? These guys have MODX Hosting perfected - SkyToaster
              • 3749
              • 24,544 Posts
              Are you using the &urlImage property? That should let you set the path you want to the BookmarkThis image folder.



              ------------------------------------------------------------------------------------------
              PLEASE, PLEASE specify the version of MODX you are using.
              MODX info for everyone: http://bobsguides.com/modx.html
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 10208 ☆ A M B ☆
                • 1,780 Posts
                That did it! Thank you.

                Although it still is unclear to me why this has to be set manually, and how BookmarkThis determines whether to add the / or not. Is it due to the fact that this is in a subfolder? Really? Love to understand why, if so.

                I've got it running in a couple of root installs and it works out of the box.
                  Frogabog- MODX Websites in Portland Oregon
                  "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                  Having server issues? These guys have MODX Hosting perfected - SkyToaster
                  • 3749
                  • 24,544 Posts
                  I've never used BookmarkThis, so I'm not sure where the slash is coming from. The unofficial rule in MODX is that any path ends in a slash (e.g., assets_path, core_path), so proper add-ons don't usually add one.


                  ------------------------------------------------------------------------------------------
                  PLEASE, PLEASE specify the version of MODX you are using.
                  MODX info for everyone: http://bobsguides.com/modx.html
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting