- Posts: 409
- Thank you received: 34
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
CKEditor and config.extraAllowedContent
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
6 years 9 months ago #156893
by blocka
CKEditor and config.extraAllowedContent was created by blocka
I need to add some social sharing buttons to the end of my survey. I'm testing out
socialsharekit.com
and looks good (plays nice with Bootstrap).
But... When i add the share anchors, like:
And I save the end message page in LS, the URLs are stripped out.
I thought adding config.extraAllowedContent = 'a[*]';
to / scripts / admin / ckeditor-config.js / ckeditor-config.js would resolve this...
But alas, it doesn't, and my < a hrefs are removed from the HTML source.
Any suggestions about how to resolve this?
But... When i add the share anchors, like:
Code:
<a href="#" class="ssk ssk-facebook"></a>
And I save the end message page in LS, the URLs are stripped out.
I thought adding config.extraAllowedContent = 'a[*]';
to / scripts / admin / ckeditor-config.js / ckeditor-config.js would resolve this...
But alas, it doesn't, and my < a hrefs are removed from the HTML source.
Any suggestions about how to resolve this?
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13645
- Thank you received: 2491
6 years 9 months ago #156898
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic CKEditor and config.extraAllowedContent
Deactivate the HTML editor. It's always the 1st think i do : set HTML editor to popup. Inline editor is awfull.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 409
- Thank you received: 34
6 years 9 months ago #156901
by blocka
Replied by blocka on topic CKEditor and config.extraAllowedContent
Hey Denis, thanks for that (as always for all your replies!).
I tried setting the editor to popup, and so I can see my HTML okay, but as soon as I use the popup editor, of course, the HTML with the empty a hrefs is lost... Since I'll have some non-techy users entering text, HTML will scare them, so they need the editor.
I wonder why the config.extraAllowedContent = 'a[*]'; doesn't work in the editor config file?
I tried setting the editor to popup, and so I can see my HTML okay, but as soon as I use the popup editor, of course, the HTML with the empty a hrefs is lost... Since I'll have some non-techy users entering text, HTML will scare them, so they need the editor.
I wonder why the config.extraAllowedContent = 'a[*]'; doesn't work in the editor config file?
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13645
- Thank you received: 2491
6 years 9 months ago #156911
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic CKEditor and config.extraAllowedContent
Didn't know about config.extraAllowedContent = 'a[*]'; (Updating and fix ckeditor config is always … difficult).
But my Point of view for non techie user.
Without HTML editor : you have
With HTML editor you have
But my Point of view for non techie user.
Without HTML editor : you have
Code:
Can you answer to this question ?
Code:
<p><span style="font-family:georgia,serif;">Can you answer to this question ?</span></p> <p> </p> <p> </p>
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 409
- Thank you received: 34
6 years 9 months ago #156930
by blocka
Replied by blocka on topic CKEditor and config.extraAllowedContent
Well, for question text, it isn't so bad. I'm thinking about welcome and end text, where they see (keeping in mind we're talking about end users who know MS Word, and have no idea what HTML means):
Code:
<p style="text-align: center;"><img alt="" src="/upload/surveys/261576/images/ThumbsUp.png" style="width: 78px; height: 78px;" /></p> <p style="text-align: center;"><strong>Thank you.</strong><br /> Your application has been received. <br /> Remember, <strong>you are the leaders of today</strong>!<br /> What you do, what you say, and the choices you make will have an impact for years to come.</p> <p style="text-align: center;"><br /> If you wish to save your answers, please click the Print link below.</p> <!-- Next section shows social buttons --!> <div class="ssk-group" style="text-align:center;"> <div class="ssk-group ssk-count"> <a href="#" class="ssk ssk-facebook"></a> <a href="#" class="ssk ssk-twitter"></a> <a href="#" class="ssk ssk-google-plus"></a> <a href="#" class="ssk ssk-email"></a> <a href="#" class="ssk ssk-linkedin"></a> </div> </div>
The topic has been locked.
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 409
- Thank you received: 34
6 years 9 months ago #156932
by blocka
Replied by blocka on topic CKEditor and config.extraAllowedContent
I figured it out...
In the scripts/admin/ckeditor-config.js file, insert
config.protectedSource.push(/<a[^>]*><\/a>/g);
before the line:
config.autoParagraph = false;
It could go elsewhere, but this groups those directives together.
In the scripts/admin/ckeditor-config.js file, insert
config.protectedSource.push(/<a[^>]*><\/a>/g);
before the line:
config.autoParagraph = false;
It could go elsewhere, but this groups those directives together.
The topic has been locked.