1
Peekay
Can the DHTML editor create H1 heading tags?
  • 2007/7/19 11:29

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


I'm sure I saw a post about this somewhere before, but couldn't find it.

Is it possible to hack the DHTML editor so using the 'Large' tags creates:

<h1>Heading</h1>


instead of:

<span style="font-size: large;">Heading</span>


A thread is for life. Not just for Christmas.

2
christian
Re: Can the DHTML editor create H1 heading tags?
  • 2007/7/19 11:39

  • christian

  • Just can't stay away

  • Posts: 401

  • Since: 2002/2/24


Yes you are right, it's a Herve Thouzard article that you can look here(sorry it's in french

3
Peekay
Re: Can the DHTML editor create H1 heading tags?
  • 2007/7/19 12:05

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Many, many thx Christian!

That makes a world of difference. Improves semantics and better for SEO too.

Roughly translated to English, Herve says:

For XOOPS 2.0 and for XOOPS 2.2, open the file /xoops/class/module.textsanitizer.php
Find the line below :

$replacements[] = '\1';


You'll find this line in the function 'xoopsCodeDecode'

Just after this line, insert the code below :

$patterns[] = "/[h([1-6])](.*)[/h([1-6])]/sU";
        
$replacements[] = '<h\1>\2</h\3>';


Your XOOPS now has 6 new BBCodes that can be used :

[h1 ]text[/h1 ]
[
h2 ]text[/h2 ]
[
h3 ]text[/h3 ]
[
h4 ]text[/h4 ]
[
h5 ]text[/h5 ]
[
h6 ]text[/h6 ]



You need to omit the spaces shown in the tags in the real editor. I found you can put the new pattern + replacement anywhere in the function.
A thread is for life. Not just for Christmas.

Login

Who's Online

223 user(s) are online (143 user(s) are browsing Support Forums)


Members: 0


Guests: 223


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits