I have had a few people ask me, how do I put images on my web page? I thought it would be easier to do a blog post that I can just send people to. In MODX 2.2 Media Sources were introduced. It is a nice added feature that adds a lot of functionality at our finger tips. This post will explain how to use them from a content editors point of view, so we are assuming you have already set them up. If you have not set up some Media Sources read over the documentation.
What are Media Sources?
Media Sources can be a variety of things from local web files, Amazon S3 bucket and more. But for this example they are all local web files but we have made several to separate out responsibilities for the content editors and this allows us to assign different permissions for each Media Source if desired.
- MODX Revolution 2.2+
- TinyMCE Extra installed
- Proper permission to upload files to your web server.
Use the MODX Browser to add images to your web page
- Log into your MODX Manager and then navigate to the page you wish to add the image.
- After the page loads click on the spot that you would like to have your image at with in the Content area. You should see the courser blinking.
- Now click on the Image Icon:
- A modal will pop up with a simple web form on it. Look for the funny looking icon and click on it.
- Another modal will come up with the MODX Resources Browser. It has three columns on it. The left column has your different Media Sources (the drop down) and then it shows the folders/directories below. The center column shows all files that are in the selected folder. You can also filter or search through the list. The right column simply show information about the current selected file from the center column.
- Now select the Media Source that seems the most appropriate for what you are doing and then click on the folder/directory that you wish to add your image or sub folder.
- Optional create a sub folder/directory. Depending on your needs you may want to create a sub folder/directory. Simply click on the folder icon and then fill in a name. When you create a folder/directory I recommend using only alphanumeric lowercase with instead of spaces use “-“. Make sure you select the newly created folder before going further.
- Upload your image by clicking on the Upload icon.
- Another modal will pop up with a simple form on it. Click on the Add button and select your image.
After you select your image you will see its name with a note that it is Queued for upload. So it is not uploaded yet and if you want you can add more than one image using the Add button. You will need to click on the Upload button. The note will change once the image is uploaded and then click the Close button.
- If you do not see your uploaded file you may need to click on the folder that you just uploaded your image into. Now click on the photo you wish to insert into the content area and then click the OK button on the lower right of the modal.
Now you will see your image on the preview box and you will need to fill in an Image Description.
- Now click on the Appearance tab and if you want to change the alignment set it in the drop down. When you are ready click on the Insert button.
- Your image has now been put into the Content area. If you want to move the image around you may now click on the image and try dragging it around. Make sure you now save your work!