Notifications
Clear all

wpForo 1.x.x [Closed] html tags in topics

5 Posts
2 Users
0 Likes
1,368 Views
Posts: 3
Topic starter
(@audrey)
Active Member
Joined: 4 years ago

Hi!

First thing, I really impress with your plugin! It have all I need (not like bbpress who I have multi problem)

But I have one thing before I make the move to change from bbpress to wpforo. I have this code here that I want to be able to put in a reply. For me and the users of my website. I what them to be able to customize their post without restriction. With bbpress, I can but not with wpforo. 

<link href="https://sd-1.archive-host.com/membres/up/18231708113007531/Axelcode.css" rel="stylesheet"><link href="https://fonts.googleapis.com/css?family=Dancing+Script|Philosopher" rel="stylesheet"> <div class="axel-cadre"><div style="background: url('https://redcdn.net/hpimg15/pics/629771lznnooae.png') repeat;"><div style="background: url('https://redcdn.net/hpimg15/pics/934271axelrpp.png') no-repeat top center; width: 600px; height: 250px;"></div>

I tried to put the html tags in the Allow extra html tags like so:

https://imgur.com/bSK51ph

Is it possible to make this work? Because I really want to use wpforo for my web site.

Thank you!

4 Replies
Alvina
Posts: 1869
Moderator
(@alvina)
Member
Joined: 4 years ago

Hi @audrey,

We suggest you don't add the <link> tag in reply content, it causes <link> tag duplication.

Also please  note you can insert <link> tag only in the <head> tag.

However, if you just need to add a CSS code, you can use the WordPress hooks for that.

Also, we may suggest to check out the following article:

https://developer.wordpress.org/reference/functions/wp_enqueue_style/

3 Replies
(@audrey)
Joined: 4 years ago

Active Member
Posts: 3

@alvina

Hi!

On bbpress I can use the <link> and I don't want to manually input the css stylesheet for every members that I have and want to use their own css for posting their reply. This is too much time and not efficient at all! Add the <head> don't work on your text editor, I did test that.

Also, I am not a developper/programmer. I don't know how to use hooks or the wp enqueue style to do what I want without extra work from me and my members.

This for example, don't even work on the text editor:

<div style="background: url('https://redcdn.net/hpimg15/pics/629771lznnooae.png') repeat;">

Why is it not possible to put background image like that?

Is there any way to enable to use those codes in the text editor of your plugin? For example, on bbpress I just add this code:

add_filter( 'bbp_kses_allowed_tags', 'ntwb_bbpress_custom_kses_allowed_tags' );
function ntwb_bbpress_custom_kses_allowed_tags() {
return array(
'a' => array(
'class' => array(),
'href' => array(),
'rel' => array(),
'title' => array(),
'style' => true,
),
'code' => array(),
'del' => array(
'datetime' => array(),
'title' => array(),
),
'dd' => array(),
'div' => array(
'class' => array(),
'title' => array(),
'style' => array(),
),

return $allowed_tags;
}
Alvina
Moderator
(@alvina)
Joined: 4 years ago

Member
Posts: 1869

@audrey,

I apologize for the late response.

The <link> tag can't be added in post content, because the wpforo use tinymce text editor and it doesn't allow the tags.
As far as bbpress doesn't use tynymce editor so it allows you to add the <link> tag.
regarding the <div> tag issues, this is doesn't have any relation to wpForo, it comes from the WordPress side.
In any case, if you need to use the <div> tag, please send the admin login detail to info[at]gvectors.com email address to allow us to fix it for you.
Also please note this is not recommended by our developers, as far as each time when you update the WordPress all changes will be lost.

(@audrey)
Joined: 4 years ago

Active Member
Posts: 3

@alvina

Don't worry about that 😉 

Yeah, for the <link> it's TinyMCE that don't want to allow that html tag, but I use TinyMCE in my bbpress forum and it's all good (only if you don't return in the text tab). And your version of TinyMCE don't allow the insert of image or background image like in the code in my first post in a div tag. So is there really no way to make that work?

So far, I manage to have this result with the wp_enqueue_style like you suggest:

https://imgur.com/Hi6Kbvt

But it's far from the real result (This is in wpforo in the "preview". The add the <link> into a <head> tag. This appen only when I do that. Exemple: <Head><link...></head>)

https://imgur.com/ZhioH1k

And, another thing, I install the TinyMCE Advanced plugin, but I think wpforo don't allow this plugin to be enable.

For the div tag, i'm using a test domain for wpforo. Just so I can explore the plugin, so it's not in my real domain.

I also use a childtheme for/and the function.php in the apperance panel so I don't lost any changes. I don't like make changes in the files directly.

Thank you!