Script URL: https://fancyapps.com/fancybox/3/
Version of script: 3.5.7
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
Write your message below: Does somebody know how to add rules to HTML Purifier? I need to add some attributes, such as data-fancybox, data-caption, etc. I would like to use Fancybox plugin in our Knowledge Base because some pictures too small. But HTML Purifier deleting fancybox attributes after saving.
Can't using fancybox plugin
Moderator: mkoch227
Re: Can't using fancybox plugin
You will need to add custom definitions. Try this:
1. open file \inc\htmlpurifier\HeskHTMLPurifier.php in Notepad++ or other powerful editor
2. find line
3. just ABOVE that line add definitions, like:
(add additional data attributes and also for other HTML elements than "a" if you need them).
4. save, upload and test
1. open file \inc\htmlpurifier\HeskHTMLPurifier.php in Notepad++ or other powerful editor
2. find line
Code: Select all
$purifier = new HTMLPurifier($config);
Code: Select all
$def = $config->getHTMLDefinition(true);
$def->addAttribute('a', 'data-fancybox', 'Text');
$def->addAttribute('a', 'data-caption', 'Text');
4. save, upload and test
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Re: Can't using fancybox plugin
It works like a charm. You are the best. Thanks a lot 
I've been trying this definition below
and it doesn't worked.
Have a nice day!

I've been trying this definition below
Code: Select all
$config = HTMLPurifier_Config::createDefault();
Have a nice day!