Can't using fancybox plugin

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
evilfossa
Posts: 2
Joined: Tue Jun 30, 2020 10:38 am

Can't using fancybox plugin

Post by evilfossa »

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.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: Can't using fancybox plugin

Post by Klemen »

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

Code: Select all

$purifier = new HTMLPurifier($config);
3. just ABOVE that line add definitions, like:

Code: Select all

$def = $config->getHTMLDefinition(true);
$def->addAttribute('a', 'data-fancybox', 'Text');
$def->addAttribute('a', 'data-caption', 'Text');
(add additional data attributes and also for other HTML elements than "a" if you need them).

4. save, upload and test
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image 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
evilfossa
Posts: 2
Joined: Tue Jun 30, 2020 10:38 am

Re: Can't using fancybox plugin

Post by evilfossa »

It works like a charm. You are the best. Thanks a lot :)
I've been trying this definition below

Code: Select all

$config = HTMLPurifier_Config::createDefault();
and it doesn't worked.
Have a nice day!
Post Reply