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

    I’ve got two images (’visuals’ of a sort) inside a template I’m working on. However those images should be different from page to page.

    One of them is on every page, the other isn’t needed at all for a couple of pages (and leaving it out won’t break the lay-out).

    Can I put some kind of place-holder in the code which can be filled in later through the ModX web interface or browser-based Editor (and which can be empty)?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Yes. Use Template Variables with input type Image and an image output widget. You can either have a default image, or leave the default blank.
        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
        • 6562
        • 37 Posts
        I did like you said, but the "Resource File Browser" (FCKEditor) page doesn’t show up, I can’t browse to another folder. Also when I try to upload something, it tells me "Disallowed file type" even though jpg’s are allowed in the Configuration input field.

        Also, when I fill in a default value and fill in e.g. /images/mypicture.jpg, it does accept that and it shows up on the resulting page.

        Edit: I changed security permission for the user I am working with. Now I get the error "Failed to upload file, internal error" when I try to upload something.
          • 7231
          • 4,205 Posts
          Now I get the error "Failed to upload file, internal error" when I try to upload something.
          This is usually a file permission issue. Did you set the permissions on the folders so that they can be written to?
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 6562
            • 37 Posts
            Quote from: dev_cw at Aug 06, 2008, 06:11 AM

            Now I get the error "Failed to upload file, internal error" when I try to upload something.
            This is usually a file permission issue. Did you set the permissions on the folders so that they can be written to?

            I will check that. I think I might have messed up my settings, so I’m re-installing ModX ’from scratch’ (I didn’t find a ’restore defaults’ function?). For example my images were in /var/www/modx/assets/images/ but for some reason when I upload a file and insert it in a template, the image’s URL gets written as ’/images/file.jpg’ , not ’/modx/images/file.jpg’ or ’images/file.jpg’ ... I’ve got another website in the root folder ( in / ) and there are images over there, but those are not the images I want...

            Anyway, I’m re-installing and hopefully that will take care of a number of things.
              • 6562
              • 37 Posts
              Okay, reinstalling and creating my templates and pages (from a backup) again solved the problem for me... phew!

              I’ve got my basic template all set up now... cool! smiley