The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

HTML in post preview not working

2 posters

Go down

Solved HTML in post preview not working

Post by LeChat Fri Sep 29, 2023 10:46 pm

Technical Details


Forum version : #phpBB3
Position : Founder
Concerned browser(s) : Mozilla Firefox, Google Chrome, Opera, Safari
Who the problem concerns : All members
Forum link : http://cadikim.forumpl.net

Description of problem

Hey, I promise this is one of the last questions! Several of the css classes (most of them are --var function) do not work in post preview and in searching all user's posts. However, it works very well in the users post.

PA > Allow HTML in User Posts: Enabled
Profile > Always show HTML: Enabled

VIEW IN POST
HTML in post preview not working IYU6QNC

VIEW IN PREVIEW
HTML in post preview not working 1caDWZG

VIEW IN ALL USER'S POST SEARCHING
HTML in post preview not working J4BYFPc

How I can fix it?


Last edited by LeChat on Sat Sep 30, 2023 1:26 pm; edited 1 time in total
LeChat
LeChat
Forumember

Posts : 39
Reputation : 1
Language : english, polish

http://cadikim.forumpl.net

Back to top Go down

Solved Re: HTML in post preview not working

Post by Razor12345 Sat Sep 30, 2023 9:09 am

Good morning!

HTML in post preview not working Scree387

I see that the CSS code doesn't see the --grupo-color variable

Are you sure you declared the CSS --grupo-color variable globally (AP - Display - Color & CSS - CSS Stylesheet) and not locally in some template (like viewtopic_body)?

Here I see all your CSS variables
HTML in post preview not working Scree385

I don't see --grupo-color in that list
But I can see that this variable exists somewhere:

HTML in post preview not working Scree386

Try adding the --grupo-color variable globally in AP - Display - Colors & CSS - CSS Stylesheet


HTML in post preview not working Screen51
Razor12345
Razor12345
Support Moderator
Support Moderator

Male Posts : 1542
Reputation : 266
Language : Ukr, Rus, Eng
Location : Ukraine

Back to top Go down

Solved Re: HTML in post preview not working

Post by LeChat Sat Sep 30, 2023 11:45 am

--grupo-color is the color of the user's group. I have a script for this variable in viewtopic_body that reads the user's group color. That's why I don't have it in my CSS.

It looks like this:

Code:
<script>$(document).ready(function(){
$('.name-post span').each(function(){
var grupoColor = $(this).css('color');
$(this).parents('.post').attr('style', '--grupo-color: ' + grupoColor + ';');
});
  });</script>

I tried to add this script in PA > Modules > JS, but it didn't help. :C

Edit: Actually, now I see that in preview and preview of the all posts parent class .post don't exist, that's why this script isn't working. But I don't know JS at all. Can we fix this?


Last edited by LeChat on Sat Sep 30, 2023 11:51 am; edited 1 time in total
LeChat
LeChat
Forumember

Posts : 39
Reputation : 1
Language : english, polish

http://cadikim.forumpl.net

Back to top Go down

Solved Re: HTML in post preview not working

Post by Razor12345 Sat Sep 30, 2023 12:10 pm

You sent a script that will definitely not work because in AP - Modules - Javascript codes management does not use the script tag when inserting code.

Edit: Actually, now I see that in preview and preview of the all posts parent class .post don't exist, that's why this script isn't working. But I don't know JS at all. Can we fix this?

Send me a private message with login and password for an account with admin rights


HTML in post preview not working Screen51
Razor12345
Razor12345
Support Moderator
Support Moderator

Male Posts : 1542
Reputation : 266
Language : Ukr, Rus, Eng
Location : Ukraine

Back to top Go down

Solved Re: HTML in post preview not working

Post by LeChat Sat Sep 30, 2023 12:18 pm

Now, I tried to copied this script from viewtopic_body to posting_preview but it didn't worked.

I think a classes in posting preview are different than in viewtopic_body, that's why script is not working, but I don't know a JavaScript and I don't know, how to fix it.

Am I right, or there is another problem there too?

Edit:

Send me a private message with login and password for an account with admin rights

Ok!
LeChat
LeChat
Forumember

Posts : 39
Reputation : 1
Language : english, polish

http://cadikim.forumpl.net

Back to top Go down

Solved Re: HTML in post preview not working

Post by Razor12345 Sat Sep 30, 2023 1:24 pm

Your PM has been received with thanks.
Please read our forum rules: ESF General Rules


HTML in post preview not working Screen51
Razor12345
Razor12345
Support Moderator
Support Moderator

Male Posts : 1542
Reputation : 266
Language : Ukr, Rus, Eng
Location : Ukraine

Back to top Go down

Solved Re: HTML in post preview not working

Post by LeChat Sat Sep 30, 2023 1:30 pm

Thank you for your help, I marked it as solved.
LeChat
LeChat
Forumember

Posts : 39
Reputation : 1
Language : english, polish

http://cadikim.forumpl.net

Back to top Go down

Solved Re: HTML in post preview not working

Post by Razor12345 Sat Sep 30, 2023 1:31 pm

You are welcome!

Problem solved & topic archived.
Please read our forum rules: ESF General Rules


HTML in post preview not working Screen51
Razor12345
Razor12345
Support Moderator
Support Moderator

Male Posts : 1542
Reputation : 266
Language : Ukr, Rus, Eng
Location : Ukraine

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum