Jump to content

Recommended Posts

Posted

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

 

Could contain: Person, Human, Text, Menu

Same post, switched to Light theme :

Could contain: Page, Text, Person, Human, Envelope, Postcard, Mail

 

Completely messed up post on Dark theme.

Could contain: Text, Mobile Phone, Electronics, Phone, Cell Phone, Menu, Page

 

How can i fix this ? I moved from XF to IPB and never had this issue before.

Waiting for your reply.

Posted

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. 

Posted
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

Posted
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.

Posted

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

Posted
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:

image.png.f6a3ebda28bede61cc1d99ea20a2c29e.png

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

 

Posted
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?

Posted (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...

  1. Edit your globalTemplate template in your theme.
  2. 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 by Nathan Explosion
Posted
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 

Posted
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.

Could contain: Text, Menu

 

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.

 

 

Posted

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...

Posted (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.

Could contain: Text

my background is black and my font is white on my website.

How to place in the code ?

Edited by Denniz38
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...