Jump to content

LAPS

Members
  • Posts

    258
  • Joined

  • Last visited

Everything posted by LAPS

  1. @BitPoet, now it works but only when using http://127.0.0.1:8888, not http://localhost:8888/.
  2. I am using ProcessWire 3.0.62 and I do not have languages active. I installed the latest version of ProcessMention, but I continue to get the '301 Moved Permanently' from http://localhost:8888/ADMIN-PATH/mention. However, if I use http://127.0.0.1:8888/ADMIN-PATH/mention, it seems to work a little more: I get a 200 OK response but the "list of mentions" is not populated because the response code is an entire HTML page (including css, js, etc.).
  3. @BitPoet, thank you for your effort. I tried your ProcessMention module, and it does not work (see below). However, ... ... I could suggest: In the README.md file > Installation, you can add the step "Copy ProcessMention.css and ProcessMention.module from the module folder to the site/modules/InputfieldCKEditor directory. ... I have to say: Rather than querying the server every time via Ajax to get mentions, you could cache the mentions client-side (in a hidden HTML element, local storage or JS config) - credit Of course, the output (e.g. fix positioning of selection list in plugin.js) is important. Regarding my issue with the ProcessMention module, when I type the e.g. @Sca text then the Ajax-HTTP request is fired but I get the following Network Headers: Note: In the image, the gray-covered areas are the path to access the admin of my PW installation. P.S.: I read the code and I would help someway, but I have to learn a little more about github and the languages.
  4. The browser cache was the problem. After clearing the cache, in the Edit Page view the Styles menu lists items that I set for it: CKEDITOR.stylesSet.add( 'mystyles', [ { name: 'Inline Code', element: 'code' }, { name: 'Inline Quotation', element: 'q' }, { name: 'Blockquote', element: 'blockquote', attributes: { 'class': 'blockquote' } }, { name: 'Small', element: 'small' }, { name: 'Deleted Text', element: 'del' }, { name: 'Cited Work', element: 'cite' } ] ); However, in order to make the <blockquote> to have the class="blockquote" I have to make more actions that it could be needed: Click the "Block Quote" button in the CKEditor menu. Focus on the "block quoted" text and select the "Object Styles > Blockquote" item from the Styles menu. Is there a way to add <blockquote class="blockquote"> within the CKEditor content avoiding the second action?
  5. My main purpose is to make it smarter for users to finding and linking pages inline while typing, and also make the linked text not modifiable. For example, a user should be able to "mention"/"suggest" a page by title and the exact title should be added to the CKEditor content, just as made in this forum for @users. It should be clear for users that it is not just linked text but something more than that. In the next future, I am also looking for retrieving some more page information on event "mouse over" the linked text.
  6. I see it really hard to implement the feature almost from scratch. I added it to the wishlist.
  7. It would be great if a PW module or tutorial for CKEditor autocomplete/mentions/suggestions will be available in the future. That is, something as what works in the "body" inputfield for posting on this forum by typing the '@' char and selecting the user in the showed list e.g. @ryan. At the moment nothing is available, even if one want to pay for it. Are there any plans to add such a feature?
  8. Thank you, @kongondo. It is a starting point. In the meantime, hoping for other replies, I had a doubt: supposing that a CKEditor plugin exists for querying the server, to which URL/path of the PW installation the AJAX-HTTP requests should be directed to in order to find/return the pages?
  9. Hi, in the "body" inputfield for posting on this forum any user can be "picked" by start typing the '@' char and selecting the user in the showed list e.g. @ryan How can I make that in/for my body CKEditor inputfields? Is there a PW module of which I am not aware?
  10. Hi @elabx, thank you for your reply. I followed the linked instruction for CKEditor settings: I also added the <PW ROOT>/site/modules/InputfieldCKEditor/mystyles.js file but with one style for testing: CKEDITOR.stylesSet.add( 'mystyles', [ { name: 'Inline Code', element: 'code' } ]); However, in the Edit Page view the Styles menu lists items that I didn't set for (e.g. "Small"): What could be the problem?
  11. I am using ProcessWire 3.0.62 and Bootstrap 4. I have a CKEditor input field where, for example, I can add the <blockquote> HTML tag by clicking the related blockquote button of CKEditor. The CKEditor itself generates the following source code: <blockquote> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> </blockquote> In the Admin Edit Page view of a page using the CKEditor input field I can add the <blockquote> and see that it is properly outputted within the input field with pre-defined styling. However, it outputs just the <blockquote> tag, without any CSS. I would like to output the <blockquote> and format it "a là Bootstrap way" (<blockquote class="blockquote">) so that the output should be something as follows: <blockquote class="blockquote"> <p class="mb-0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> </blockquote> In the Admin Edit Field view of the CKEditor there are lots of options (e.g. Extra Allowed Content, Custom Editor CSS File, Custom Editor JS Styles Set, Custom Config Options, etc.) and I tried to set someones, but without success for outputting the <blockquote class="blockquote"> as above, automatically (i.e. auto-adding the CSS class 'blockquote' when I click the blockquote button of CKEditor). Is it possible to make that by using PW-CKEditor? Is it the right way to proceed?
  12. @kongondo, I tried many ways to state that particular hook separately, including your that does not work. It seems that, even if the 'hookFunction' is called, within the 'hookFunction' the $object is not modified "persistently", maybe because it is not passed by reference. This way, the $object value modified internally to the 'hookFunction' is not modified for use within other, subsequent hooks-functions.
  13. Hi, I am a newbie in PHP, and I am learning PW including hooks. In my ready.php file I have PHP code and a PW hook stated as follow: $object = ...; wire()->addHookBefore('Pages::save', function ($event) use (&$object) { ... } I would like to define a 'hookFunction' separately, something like this: wire()->addHookBefore('Pages::save', null, 'hookFunction'); However the issue is in stating separately the 'use (&$object)' part. I know that the 'use' language construct is used for "anonymous functions" and the '&' is used for "passing by reference", but how can I state the hook function separately? P.S.: Maybe there is a better way (that I do not know) to state the above, hook-related code at all.
  14. OK, we are close to the solution. If it can help, I am using: ProcessWire v3.0.62 Login/Register v0.0.2 with option "Features to use" set to all (including "Use email address for login rather that user name") and option "Profile form fields" set to "E-mail Address (required)" and "Set Password (required)" more "First name" and "Last name". Furthermore, after the login form submission (failed) in the Session logs I get these 2 rows: 2 seconds ago --- Error: Failed login for '' - Unknown user: 2 seconds ago --- Error: Failed login for 'my_email-email.com' - Unknown user: my_email-email.com
  15. Yes, the reCapatcha widget is "green-checked". I tested it in a regular form, and it works as expected. It does not work just for the Login-Register login form.
  16. In Google Admin I set 'localhost' and '127.0.0.1' (see attached image). I tried to submit the login form from both 'http://localhost:8888/login' and 'http://127.0.0.1:8888/login' without success: I get the "Login failed" message. Note: If it can help, in Google Admin I cannot set 'localhost:8888' nor '127.0.0.1:8888' since I get the error "URL starts with an invalid scheme".
  17. @flydev, Thank you for your hint. Now the reCAPTCHA is visible in the login form (see the attached image). However, even when submitting the correct user credentials, I get always the "Login failed" message. What's wrong?
  18. Hi @flydev, thank you for you reply. However, your code seems do not work. In particular, it seems do not output the JavaScript-related code ($captcha->getScript()). Can be this the problem? Note: I am testing MarkupGoogleRecaptcha in localhost, so in Google Admin I added the domains 'localhost' and '127.0.0.1'.
  19. I am wondering to add the reCAPTCHA to the login form of the Login-Register module. I tried to make it by using the MarkupGoogleRecaptcha API in a hook, but without success: // ready.php file wire()->addHookAfter('LoginRegister::buildLoginForm', function($event) { $form = $event->return; // call the module and render reCAPTCHA $captcha = wire('modules')->get("MarkupGoogleRecaptcha"); $captcha->render($form); // add JavaScript to the form $js = $captcha->getScript(); // ... str_replace("</form>", "{$js}</form>", $form); // Call verifyResponse() to get the result. // ... $event->return = $form; }); Furthermore, I do know if it is possible to add reCAPTCHA from within a hook. Can someone help me in adding the reCAPTCHA to the login form of the Login-Register module?
  20. OK, it works. Thank you for your replies.
  21. @DaveP I tried to put the favicon.ico file in /, /site, /wire and others directories, as well as refresh both PW and browser cache, but it does not work. I also added the link code in the <head> tag of my template file, as follows: <link rel="icon" type="image/x-icon" href="favicon.ico">
  22. @kongondo I read the linked answer, but what is the webroot in PW? I mean, what is the directory (e.g. /site, /wire) where I have to put my favicon file(s)?
  23. I tried to do some search, but I did not find how to setup a favicon for my PW website e.g. where to put favicon file(s)?
  24. I am using the LoginRegister module and I would like to display a different, login-related menu item to logged in users. That is, in my navigation menu I have the "Login" item through which the user can log in (a template file with the code "echo $modules->get('LoginRegister')->execute();") and I would like to display that item with the name "Account" when the user is logged in. Is there a common solution for this?
  25. I am using the LoginRegister module and I would like to set custom roles for new registered users. I read the documentation and the LoginRegister.module source code. In the latter there is: * CONFIGURATION PROPERTIES * [...] * @property array $registerRoles Name of roles to add to users created from register form. * [...] I am not sure how to set roles, but I am pretty sure it should be made in a hook (maybe, the 'createUserReady'). Can you help me in setting custom roles for new registered users?
×
×
  • Create New...