bbeer Posted October 1, 2014 Share Posted October 1, 2014 Hi all when I try to delete a table by right clicking into the table, then delete table, the table reappears after savaging the page. However when the table is deleted in html mode then it is gone. However this is not a smart option for clients. PW Version 2.4.0 CKEditor Version 1.2.0 Your help is much appreciated! Link to comment Share on other sites More sharing options...
bbeer Posted October 2, 2014 Author Share Posted October 2, 2014 Sorry that I push on this subject again, but this is getting really urgent. I use CKEditor with a TextaeraLanguage field. When using tables, CFE add endless <p> </p>, really unpredictable. It is impossible to control text like this. Even worse, some language tabs are not displayed, as they should, but in the text itself. Text disappears completely, if it was not saved. when changing language, it is easily possible that the format of the field you choose now breaks, without even activating CFE all <br /> are being replaced by <p> </p> I need urgent help. Also paid help if necessary. Thanks a lot Link to comment Share on other sites More sharing options...
arjen Posted October 2, 2014 Share Posted October 2, 2014 I'd be happy to help. Can I take a look somewhere? You can PM me the login details. Don't know if I can make it today, but I can take a look tomorrow early in the morning before work or in the evening (Amsterdam timezone). I have a PW 2.4 with CKE 1.2.0 (default config) and have no problems. Have you tried other browsers? Have you installed any plugins in CKE? You also may want to switch the field to plain textarea and then back. 1 Link to comment Share on other sites More sharing options...
bbeer Posted October 7, 2014 Author Share Posted October 7, 2014 Hi all back to the topic. we are closer already and found out that CKE is adding a lot of additional tags. ie. <p> </p>, it also wraps text inside td's and list inside paragrahps which we really can't use, because we use the content with a pdf generator. Is it possible to limit CKE that he does not add additional tags inside li and tds? that would really help a lot. your help is much appreciated. Link to comment Share on other sites More sharing options...
bbeer Posted October 13, 2014 Author Share Posted October 13, 2014 Hi all after trying a lot of option, I really need to ask how the proper syntax for extra allowed content is. Whenever I use extra allowed content I get an error Error: Call to a member function set() on a non-object (line 118 of /public_html/entwicklung/site/modules/MarkupHTMLPurifier/MarkupHTMLPurifier.module) In one setup I would need CKEditor to just allow table tbody tr td br em li a. I also realized that CKEditor is adding p to li elements, which is no good. Your help is much appreciated. Link to comment Share on other sites More sharing options...
kongondo Posted October 13, 2014 Share Posted October 13, 2014 (edited) Add the following to your Extra Allowed Content (Input tab when editing your field) table[class](*) tr[class](*) td[class](*) tbody[class](*) em[class](*) br[class](*) What the above mean is that those tags will be allowed and they will also be allowed to have 'classes'. Have a read from here downwards for some quirks with HTML5 Also see the setting Beautify Markup Toggles: helps remove empty <p></p> tags and Btw, why do you need the <em> again? You already have that with CKEditor...Also inbuilt lists work just fine for me...No extra <p> added. Edited October 13, 2014 by kongondo 1 Link to comment Share on other sites More sharing options...
bbeer Posted October 13, 2014 Author Share Posted October 13, 2014 thanks kongondo does not solve the problem. As soon as I add anything to Extra Allowed Content I get the above mentioned error. Further more I have only one line to add Extra allowed content, so separated it by , like table[class](*), tr[class](*), td[class](*), tbody[class](*), em[class](*), br[class](*) on line 118 is following code. like $this->settings->set($key, $value); Where can I find Beautify Markup Toggles settings? Thanks for your help! Link to comment Share on other sites More sharing options...
kongondo Posted October 13, 2014 Share Posted October 13, 2014 (edited) I see now that according to your first post, you have CKEditor version 1.2.0? No wonder it doesn't work ...I am on PW 2.5 with CKEditor 4.4.3. CKEditor is now the default editor in PW. I think your version is the old one from the modules directory. I urge you to upgrade to PW 2.5 . The extra allowed content in PW 2.5 is a textarea. The code I posted above should be entered just as I have shown. One line of code per line. When you upgrade you will also be able to see the 'Beautify....' settings... Edited October 13, 2014 by kongondo Link to comment Share on other sites More sharing options...
bbeer Posted October 13, 2014 Author Share Posted October 13, 2014 I've updated InputfieldCKEditor to Version 1.2 which includes ckeditor 4.4.2 this is a PW 2.4 Installation. So that means I will have to update to PW 2.5 if that should work correct right? Will do so, hope that helps. Link to comment Share on other sites More sharing options...
kongondo Posted October 13, 2014 Share Posted October 13, 2014 Correct Link to comment Share on other sites More sharing options...
bbeer Posted October 14, 2014 Author Share Posted October 14, 2014 thanks kongondo seems that my problem is solved, or at least almost solved. Guess we need to filter some content by php for output into the pdf generator. Thanks again! Link to comment Share on other sites More sharing options...
kongondo Posted October 14, 2014 Share Posted October 14, 2014 Glad it's working. What are the outstanding issues? Link to comment Share on other sites More sharing options...
bbeer Posted October 14, 2014 Author Share Posted October 14, 2014 well it happens that inside td's are p. which for our need is really a no go. The same with li's. under certain circumstances there are p inside li's which breaks the layout in the pdf. The main problem is that with tcpdf you can only use inline styles. We are using PW to generate a dynamic manual, so there is no other way but to give the client a wysywyg editor. Link to comment Share on other sites More sharing options...
kongondo Posted October 14, 2014 Share Posted October 14, 2014 That's strange. How is the table being created? Using source view? I doubt the client knows HTML though . Anyway, in my case, I see no <p>'s inside <li> nor in <td>s.. Link to comment Share on other sites More sharing options...
arjen Posted October 14, 2014 Share Posted October 14, 2014 Good news bbeer! I believe it's possible to have ACF filter out p inside td. But the main thing is how do the p's get there? Link to comment Share on other sites More sharing options...
kongondo Posted October 14, 2014 Share Posted October 14, 2014 To answer my question. I am guessing you added 'Table' to the CKEditor Toolbar. You are then inserting tables using the Table icon, correct? I have tested this too and it works fine. I can right click and delete the table and it disappears; it doesn't come back after save . I have also double checked and there are no <p>s in the <td>s. The only way to get <p>s inside the <td> is if you type and press enter to create a new line within the <td> . I think that's what your client is doing? Unrelated, but good to know that using the tab key to move within cells works fine Link to comment Share on other sites More sharing options...
kongondo Posted October 14, 2014 Share Posted October 14, 2014 Btw, just realised that with 'Table' added to the CKEditor Toolbar, you don't need to add any other Table Markup to the Extra Allowed Content. It will work just fine... Link to comment Share on other sites More sharing options...
bbeer Posted October 15, 2014 Author Share Posted October 15, 2014 it really looks as if my client was messing around. Will now update the live site. let you know the outcome. Guess it will work fine... Link to comment Share on other sites More sharing options...
bbeer Posted October 15, 2014 Author Share Posted October 15, 2014 Ok after updating and testing, there is still an issue, that there are paragraph's inside td's like here <table border="1" cellpadding="0" cellspacing="0"><tbody> <tr> <td style="width:45px"> <p> 1</p> </td> <td style="width:170px"> <p> Besfestigungsdichtung</p> </td> </tr> <tr> <td style="width:45px"> <p> 2</p> </td> <td style="width:170px"> <p> Befestigungsklammer</p> </td> </tr> </tbody> </table> even when opening the editor and closing it again they resist. is there a way to have them remove on save, or some other way? It would be one hell of work if we would have to reenter all that content. Link to comment Share on other sites More sharing options...
LostKobrakai Posted October 15, 2014 Share Posted October 15, 2014 If you only need to remove them once, so that you can work further with the cleaned texts, just use the api like this: $text = $page->getUnformatted("body"); // Just to be sure that no textformatters change something $page->of(false); $text = str_replace("<p>", "", $text); $text = str_replace("</p>", "", $text); $page->body = $text; $page->save("body"); Edit: If you have normal paragraphs, too, you should use a more sophisticated search/replace option. Link to comment Share on other sites More sharing options...
bbeer Posted October 15, 2014 Author Share Posted October 15, 2014 Thanks a lot will try that. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now