We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48834
    • 13 Posts
    Good morning all,

    I just started a job (on Tuesday) and my company's website it run via MODx (probably obvious).

    I'm still getting acclimated to everything and find it a bit overwhelming when I can't figure something out. One of the most basic tasks or things I need to learn is:

    How do I upload a new image for the website
    How do I get the image url so I can code it in somewhere?

    I pretty much need to learn MODx from a to z and there is NO ONE in my office that has any idea how to use it or guide me LOL!

    Please help! and thanks!

    Mike
      • 46886
      • 1,154 Posts
      Ha looks like you are going to be learning quickly!

      For the website image, in general the site is created by using a template, and the template can have lots of different stuff within it. If the site is simple, then the image url will be right in the template itself. If you wanted to change that image, you would upload the new picture to assets/images I believe, and then manually change the link to the new image name in the relevant template.

      For example:
      <div class="col-lg-3 col-md-4 col-xs-12">
      <a href=""><img src="assets/images/logo.png" class="logo" /></a>
      </div>


      There are other ways to do this, and more involved methods when you want to do things in a unique way, but this is the basic method for pics on a page.

      So, go into the tree, and find the page you want to edit (we call it a 'resource' which is a more general term). Then make a note of the template which that page is assigned to, that's what you have to edit. Then, go to that template, find the image reference, and change it to your new image name, after uploading it of course. As long as the internal link is right, it will appear.

      EDIT: Just to be clear, the image is likely in the template but could be in the resource directly. For example, imagine I make a site with three pages, one for me, one for my cat, and one for my dog, and I want a different picture for each page. The template can contain the common header and footer, maybe other common elements. But the resources themselves will contain the pictures of me and my pets, because those are the individual resource contents rather than the template.

      HTH, and good luck! [ed. note: nuan88 last edited this post 12 years ago.]
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Here is a basic end-users guide. It is designed to be customized for a specific installation, but in its basic form it works well for beginners.
        http://shorewalker.com/site-building/modx/modx-end-user-manual.html

        You might also want to see this http://shorewalker.com/site-building/modx/how-to-set-up-a-modx-site.html
          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
          • 3749
          • 24,544 Posts
          Welcome to MODX. smiley

          What version of MODX are you using?
            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
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Yes, I hadn't even thought of that. There are two branches of MODX, the original 1.x "Evolution" code base and the 2.x "Revolution" code base. Evo is up to 1.0.15, while Revo is now at 2.3.1. The code base and internal functioning and API is quite different, but the end-user content management part is basically the same.
              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
              • 48834
              • 13 Posts
              Good morning gentlemen!

              Thank you so much for taking some time to give me advice! I greatly appreciate it!

              I'm using Modx: Evolution 1.0.2 if that helps.

              I know some html coding but I wouldn't claim to be an expert. But I can usually figure my way around it though. Right now an issue I'm having is inserting a logo to an article I posted. I managed to find a place to upload it. Much like in Nuan88's message (thank you again!):

              assets/images/New_Logo.png <-- so wouldn't that make the image url www.website.com/assets/images/New_Logo.png ?

              Doesn't have to be a totally written in lower case does it? Is there anything else I need to do once I've uploaded it to where I imagine is the appropriate place?

              Thanks again for the help guys!

                • 46886
                • 1,154 Posts
                And ladies, don't forget the ladies!

                Hey you came back! Good to see you!

                Yes, that's the default address of the pic, and MODX knows how to read that shorter address (actually the base path is in your template which tells MODX which site to use for this stuff, it actually could be on another site or whatever).

                You can use uppercase letters without a problem, I can't remember if the system would distinguish between upper and lower case, but you certainly can use upper case in your image names.

                The code will say logo goes here, and then if the image is where the code says to look, it will find it and display the image. If it does not, you may want to check the base path of the template.

                Here is what a base path looks like, in the <head> section of the template:

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

                Ah, but I think I just gave you Revolution code rather than Evolution code, sorry about that, the code system is slightly different. In Evo, perhaps only one plus sign...
                  • 3749
                  • 24,544 Posts
                  The Evolution version would be:

                  <base href="[(site_url)]" />
                    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
                    • 48834
                    • 13 Posts
                    Hah! Good to see you too!

                    Thank you both so much for responding!

                    So you're saying look at whatever page has the logo in it then locate in the coding where the logo is? I hate to ask you to explain further but can you? Like lets say I find the code that shows coding that looks like the logo, will it not have a '.png' or whatever file distinction?

                    I'll investigate and let you know how things go...

                    Thank you again ladies and gentlemen!
                      • 3749
                      • 24,544 Posts
                      Yes, it typically looks like a regular img tag with something like a .png or .jpg extension.

                      It is most likely not in the home page content (though it might be), but rather in the template used by that page or in a chunk with a chunk tag for that chunk in the template or page content.

                      If you look at the source of the page (Ctrl-u in most browsers), you'll see the link to the image, which will tell you its location. You could just find the image itself, rename it, and upload a new one with the same name to the same location. Then you wouldn't have to worry about where the img tag is.
                        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