-
Posts
1,347 -
Joined
-
Last visited
-
Days Won
16
Everything posted by Juergen
-
Hello tpr, here is another z-index problem by showing the source code via CK-Editor. You gave the divs "breadcrumbs" and "headlines" a z-index of 100011. Now there is a problem if you use the "show source code" function of the CKEditor. This window will be overlapped from the 2 divs in the static bar, because the table which holds the source code has no z-index value (only position static). The following line of CSS should solve this problem (not tested yet): table.cke_dialog_contents {z-index: 100012;} Best regards
-
Thank you all for your contribution!! Finally I ended up with this piece of code, which works as expected: <?php /** * Processwire module for adding a special class for lists added via CKEditor. * by Juergen Kern * * ProcessWire 2.x * Copyright (C) 2011 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://www.processwire.com * http://www.ryancramer.com * */ class TextformatterForLists extends Textformatter implements Module { public static function getModuleInfo() { return array( 'title' => "Textformatter for lists", 'version' => "100", 'summary' => "This little Textformatter adds a class to the ol and ul tags", 'author' => "Juergen Kern", 'requires' => array( "PHP>=5.4.0", "ProcessWire>=2.5.28" ), 'icon' => 'list' ); } public function format(&$str) { $str = str_replace('<ul>', '<ul class="textlist fa-ul">', $str); $str = str_replace('<ol>', '<ol class="rounded-list">', $str); } } It seems that the class name causes the problem, but I swear I have not the same class anywhere on the page. Maybe the CK in the classname was responsible for the behaviour. Anyway now it works.
-
Thanks for the Explanation @LostKobrakai
-
Thanks @ Robin for the hint, I know this and i have tried it without the closing tag yesterday, but there was no influence. Currently I am not at home so I cannot test all the recommendations.
-
Thanks for the tipp Adrian, I will try this if I am at home and post my results here.
-
Hello @tpr, I see you use a different approach. Your function in MultivalueTextformatter looks like public function formatValue(Page $page, Field $field, &$value) { while my function is public function format(&$str) Could this be a reason?
-
After reinstalling it is not being loaded at all, flag stays at 1 in the db and it is definitely the body field where I have applied this Textformatter. I have created another CKEditor field for testing purposes and have applied this Textformatter too - same effect. The problem is definitely that the Textformatter will not be loaded in my case. I use the latest dev version (3.0.30) of PW.
-
Flag stays at 1, but nothing happens on the frontend. I will take a closer look tomorrow.
-
Doesnt work in my case. After refreshing the modules the value is set back to 0.
-
Hmmmm! Tracy Debugger says that this Textformatter module is not loaded (I cannot find it in the list of loaded modules) The other Textformatter that I have added to the body field will be loaded (it appears on the module list of Tracy Debugger).
-
Hello BitPoet, no whitespaces or additional attributes and the content comes from the body field. Caching is deactivated. Thats the reason why I am a little bit confused why it is not working
-
Hello @ all, I have created a very simple Textformatter module which should add a class to ordered and unordered lists. <?php /** * Processwire module for adding a special class for lists added via CKEditor. * by Juergen Kern * * ProcessWire 2.x * Copyright (C) 2011 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://www.processwire.com * http://www.ryancramer.com * */ class TextformatterListCK extends Textformatter implements Module { public static function getModuleInfo() { return array( 'title' => "Textformatter for Lists", 'version' => "100", 'summary' => "This little Textformatter adds a class to the ol and ul tag (only for lists added via editor)", 'author' => "Juergen Kern", 'autoload' => false, 'singular' => false, 'permanent' => false, 'requires' => array( "PHP>=5.4.0", "ProcessWire>=2.5.28" ), 'icon' => 'list' ); } public function format(&$str) { $str = str_replace('<ul>', '<ul class="textlist fa-ul">', $str); $str = str_replace('<ol>', '<ol class="rounded-list">', $str); } } ?> Problem: This Textformatter is added to the body field, but it doesnt change anything and I could not find any mistake. Maybe someone has a better experience in creating Textformatter modules and could give me a hint why it is not working. Thanks in advance
-
I have created the exact same field and added it instead of the body field. Now everything works fine. Unfortunately I was not able to trace down the problem according to the tipps of Robin S. Thanks all for your help.
-
Hello tpr, here is a new z-index issue On th right side - the dropdown of the usermenu will be overlapped by the PW messages. Not a big problem. You can click them away, but if you have time.... Data: PW 3.0.30, Reno Theme, AdminOnSteroids 0.5.1 Best regards from the z-index man
-
Of course. This was the first that I have done.
-
Hello Webrocker, I think it has nothing to do with the page/template because if I remove the body field from the template the page can be viewed without problems. It is only depending on the field.
-
Hello @ all, I have very strange error messages if I want to render my body field in a template. First of all: This happens only if I am not logged in as administrator and only for the body field. If I am logged in with superuser rights everything seems ok. Here are the error messages from Tracy debugger: Has anyone an idea what the cause could be? Best regards Jürgen
-
Now everything works fine Here is a small video to demonstrate the ajax login process for others who are also interested in creating an similar login process. Finally I have decided to redirect to the same page instead to the profile page because I think it is much more comfortable for the user. The form will be loaded via ajax. All inputs (username, password) will be checked in real time against the database. If everything is correct, the user is able to click the button and the login process starts. After finishing the login process I use a get parameter in the url to show a success message. Best regards
-
I have added it after success error: function(data){ alert('error');//or whatever you want }
-
Thats true! I havent added it because username and password will be checked first in real time with an ajax request and it is only possible to click the submit button if everything is fine. If username and password dont match it is not possible to click the button and proceed. The second validation (not really necessary) takes place on the server with the form data submitted via Ajax
-
Hello tpr, thanks for your help! I got it working with this code: <script> $("#mainlogin-form").on('submit', function(e){ e.preventDefault(); $.ajax({ type: "POST", url: "<?php echo $pages->get('template=login')->url;?>", data: $("#mainlogin-form").serialize(), success: function(data){ window.location.href = "<?php echo $pages->get("template=profile")->url;?>"; } }); return false; }); </script> For all others who are interested in: First step: I prevent the page reload with e.preventDefault() - this is necessary to prevent the reload, otherwise you will not get logged in Second step: I made a Ajax request to my login template, where the form will be processed (validation stuff, login process,...) url: the url to my login page data : serialize all the form inputs that should be sent with the Ajax request. success: if all is alright then force a redirect to the profile page Best regards
-
Yes you are right. Now I understand it a little bit better. The page reload takes place after pressing the submit button of the login form - this is the reason for the page reload. But it seems that the the form will not be validated on the serverside, because the login process doesnt work. I will take a closer look at what happens after pressing the button. Thats what i do not want - I will dive more into Ajax because I start loving it
-
Hello tpr, if I press the login submit button from the ajax loaded page the page I am actually on will be reloaded (not the page inside the modal). Its my first attempt with ajax and login so I dont know how to get a success message from the ajax loaded login form.
-
Hello @ all, I use a login form which can be loaded via ajax from every page in a bootstrap modal or it can be reached directly with a link to a login page. My problem ist that the login and the redirect doesnt work in the modal, but it works on the login page (with the same code). Is there a special way necessary to login from an ajax loaded login form. As you can see the user will not be logged in and not redirected to the profile page. Maybe someone has done something similar and struggled with this problem too. Best regards
-
Works as far as I have tested it as expected on PW 3.29