Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted September 7, 20222 yr Hello, When i copy info from the internet and paste in my IP forum, the layout is completely messed up when using Dark and light theme. See screens: posting on Dark theme Same post, switched to Light theme : Completely messed up post on Dark theme. How can i fix this ? I moved from XF to IPB and never had this issue before. Waiting for your reply.
September 7, 20222 yr Author Thanks, if i use this, all urls are also plain text and the images copied dont appear.
September 7, 20222 yr The above would indeed be your only option there. The issue is that the source you are copying from has a background and text colour set, and so its pasting exactly what was copied there It would not paste images, as you are now pasting plain text.
September 7, 20222 yr Author Just now, Marc Stridgen said: The above would indeed be your only option there. The issue is that the source you are copying from has a background and text colour set, and so its pasting exactly what was copied there Is IPS going to edit this in the editor in a new version ? XF and VB dont copy the background. And i dont want to go back to those companies. I love IP
September 7, 20222 yr It’s always been this way ever since there were HTML posts. It’s not just background colors: if you copy raw HTML from one website to another, there could be dozens of styling declarations that could break a layout.
September 7, 20222 yr Author Just now, Marc Stridgen said: As mentioned above, this would happen in any editor I understand but we used this copy paste in our previous forum software without these issues. Always nice layout and not like not visible or blocks there.
September 7, 20222 yr Unfortunately, there isnt really much I can add to what has already been said here. Its pasting exactly what has been copied. So is a background has explicitly been set in code, it would indeed add that
September 7, 20222 yr Author What is the CSS code to force all posts in white color, regardless of the original color ? Can someone help me with this ?
September 7, 20222 yr As mentioned in your other topic, there is no code that would force it to do so
September 7, 20222 yr 3 hours ago, Denniz38 said: When i copy info from the internet and paste in my IP forum, the layout is completely messed up when using Dark and light theme. I found your topic here too. As I said earlier on Ehren's forum different browser might be a workaround: Quote Chromium browsers preserve background unlike Firefox: The only "solutions" to prevent such issue is either using Firefox for copying or globally disabling Rich text: ACP > Customization > Editor > Settings > Always paste as plain text
September 7, 20222 yr Perhaps editing a CKEditor config file will help: your site folder > applications > core > interface > ckeditor > ckeditor > ckeditor.js See Filtering Pasted and Dropped Content + pasteFilter documentations. Possibly something similar to this: CKEDITOR.config.pasteFilter = '*[color]; *{color, background-color, text-decoration}';
September 7, 20222 yr While you may be able to do that, there is no guarantee that there will be no consequences to doing so.
September 8, 20222 yr Author 19 hours ago, Luuuk said: Perhaps editing a CKEditor config file will help: your site folder > applications > core > interface > ckeditor > ckeditor > ckeditor.js See Filtering Pasted and Dropped Content + pasteFilter documentations. Possibly something similar to this: CKEDITOR.config.pasteFilter = '*[color]; *{color, background-color, text-decoration}'; What is the best way to place this line in the ckeditor.js file?
September 8, 20222 yr Author 5 hours ago, Nathan Explosion said: Thanks but does this mean can or can’t be done ?
September 8, 20222 yr It means that if you want to make a change to the CKEDITOR config then that is the best way to do it. In short... Edit your globalTemplate template in your theme. At the bottom, before closing </body>, add the following and then save the template <script> if(typeof CKEDITOR != 'undefined'){ CKEDITOR.config.pasteFilter = '<WHATEVER>' } </script> Edited September 8, 20222 yr by Nathan Explosion
September 8, 20222 yr Author 2 minutes ago, Nathan Explosion said: It means that if you want to make a change to the CKEDITOR config then that is the best way to do it. Which program to use to edit the .js file, i use text editor and notepad but the view is not good of the files
September 8, 20222 yr You are not editing a JS file - you should be editing the globalTemplate in your theme.
September 9, 20222 yr Author 14 hours ago, Nathan Explosion said: You are not editing a JS file - you should be editing the globalTemplate in your theme. I have placed this in the GlobalTemplate but no difference. The posts are exactly the same as without this code. When i use the remove formatting button on the post, thats the way it should look like.
September 9, 20222 yr I helped you with this bit: 21 hours ago, Denniz38 said: What is the best way to place this line in the ckeditor.js file? I didn't help you with this bit: On 9/7/2022 at 3:09 PM, Luuuk said: Perhaps editing a CKEditor config file will help: your site folder > applications > core > interface > ckeditor > ckeditor > ckeditor.js See Filtering Pasted and Dropped Content + pasteFilter documentations. Possibly something similar to this: CKEDITOR.config.pasteFilter = '*[color]; *{color, background-color, text-decoration}'; <WHATEVER> is a placeholder for your actual configuration...
September 9, 20222 yr Author 8 minutes ago, Nathan Explosion said: I helped you with this bit: I didn't help you with this bit: <WHATEVER> is a placeholder for your actual configuration... Thanks but still confused, im not a coder. my background is black and my font is white on my website. How to place in the code ? Edited September 9, 20222 yr by Denniz38
September 9, 20222 yr Maybe @Luuuk can help you, as they suggested that functionality as an option. But be aware that this won't have any effect on already existing content - it would be processed on new content pasted in. Edited September 9, 20222 yr by Nathan Explosion