BandiRoot Posted September 7, 2022 Posted September 7, 2022 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.
BandiRoot Posted September 7, 2022 Author Posted September 7, 2022 Thanks, if i use this, all urls are also plain text and the images copied dont appear.
Marc Posted September 7, 2022 Posted September 7, 2022 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. SeNioR- and BandiRoot 2
BandiRoot Posted September 7, 2022 Author Posted September 7, 2022 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
opentype Posted September 7, 2022 Posted September 7, 2022 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. SeNioR-, Marc and BandiRoot 2 1
Marc Posted September 7, 2022 Posted September 7, 2022 As mentioned above, this would happen in any editor BandiRoot 1
BandiRoot Posted September 7, 2022 Author Posted September 7, 2022 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.
Marc Posted September 7, 2022 Posted September 7, 2022 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 BandiRoot 1
BandiRoot Posted September 7, 2022 Author Posted September 7, 2022 What is the CSS code to force all posts in white color, regardless of the original color ? Can someone help me with this ?
Marc Posted September 7, 2022 Posted September 7, 2022 As mentioned in your other topic, there is no code that would force it to do so BandiRoot 1
Luuuk Posted September 7, 2022 Posted September 7, 2022 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 BandiRoot 1
Luuuk Posted September 7, 2022 Posted September 7, 2022 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}'; BandiRoot 1
Marc Posted September 7, 2022 Posted September 7, 2022 While you may be able to do that, there is no guarantee that there will be no consequences to doing so. BandiRoot 1
BandiRoot Posted September 8, 2022 Author Posted September 8, 2022 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?
BandiRoot Posted September 8, 2022 Author Posted September 8, 2022 5 hours ago, Nathan Explosion said: Thanks but does this mean can or can’t be done ?
Nathan Explosion Posted September 8, 2022 Posted September 8, 2022 (edited) 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, 2022 by Nathan Explosion Luuuk, aia and BandiRoot 2 1
BandiRoot Posted September 8, 2022 Author Posted September 8, 2022 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
Nathan Explosion Posted September 8, 2022 Posted September 8, 2022 You are not editing a JS file - you should be editing the globalTemplate in your theme. BandiRoot 1
BandiRoot Posted September 9, 2022 Author Posted September 9, 2022 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.
Nathan Explosion Posted September 9, 2022 Posted September 9, 2022 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...
BandiRoot Posted September 9, 2022 Author Posted September 9, 2022 (edited) 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, 2022 by Denniz38
Nathan Explosion Posted September 9, 2022 Posted September 9, 2022 (edited) 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, 2022 by Nathan Explosion BandiRoot 1
Recommended Posts