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

    Just trying to work out how to prevent TinyMCE from inserting the align attribute on images. It’s one of those cases where I need to build in a strict doctype and this doesn’t allow for the align attribute to be used.

    Any help would be greatly appreciated.

    Thanks in advance,
      • 26931
      • 2,314 Posts
      Hi jonrawlins,

      strange, i don’t have any align attributes inserted by TinyMCE (MODx 1.0.4/TinyMCE 3.3.5.1), to position images i add a css class btw. // image editin PopUp -> Appearance -> Class ( one of the css classes you define under configuration -> inteface & feature -> css selectors)

      j
        • 14677
        • 54 Posts
        Hmmm, I am using the same version however the TinyMCE selected within the configuration options is set to "creative". Just out of interest which are you using?

        I am unsure myself why it does it. I may have to switch over to not using the image widget for that particular TV. Just need to limit the size that the image will display etc.
          • 26931
          • 2,314 Posts
          is this for an imageTV?
            • 14677
            • 54 Posts
            Yea it is, I will just have to revert to a standard tv to get around the problem.

            Thanks for the help though. Just hacking TinyMCE to allow/disallow attributes is not an option for me currently.

            Thanks again.
              • 26931
              • 2,314 Posts
              as for imageTVs this has been addressed here i guess: http://svn.modxcms.com/jira/browse/MODX-2054?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aworklog-tabpanel (site doesn’t load right now)

              what’s your set up, and what do you want do acomplish exactly?

              btw. on that particular site i’ve checked it’s set to "MODx Style", but i tend to use "Custom" with a stripped out list of available buttons/plugins
                • 26931
                • 2,314 Posts
                i don’t understand grin

                you’re placing an imageTV in your TinyMCE wysiwyg field?? no need to hack TinyMCE, it works actually quite well

                sorry if i ’m too slow to understand, maybe my brain’s fried, it’s tropical hot here wink
                  • 14677
                  • 54 Posts
                  No problems, the issue is...

                  I am creating a portfolio using chunks for each document. For the portfolio docs I have a TV that you can select an image from a directory and it will display the image within the anchor tag therefore making the image clickable to view a pdf (This is how the company I work for show their work).

                  However, the image that get’s inserted into the variable placeholder on the page when loaded has align="none" assigned to it which I need to prevent.

                  I hope this explains a little more, I should be able to get around it if I manually create the image tag within the chunk. Just wanted to make less maintence in the future etc.
                    • 14677
                    • 54 Posts
                    Thanks for all the help, I think I have found a workaround which requires barely any work to fix it smiley

                    Thanks again,
                    Jonathan smiley
                      • 26931
                      • 2,314 Posts
                      maybe don’t use the image widget for the output and create the structure of the image tag from within your chunk