Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/06/2017 in all areas

  1. If people come up with any nifty usages of HannaCodeDialog it would be cool to get a bit of a library going in this thread. Here's one to get the ball rolling. Select FormBuilder form For the foolproof selecting of a FormBuilder form to embed in a CKEditor field. Import both of the export strings to use this. The code is shown here just for reference. _formbuilder_forms Export string (import this into Hanna Code): !HannaCode:_formbuilder_forms:eyJuYW1lIjoiX2Zvcm1idWlsZGVyX2Zvcm1zIiwidHlwZSI6IjIiLCJjb2RlIjoiPD9waHBcbmVjaG8gaW1wbG9kZSgnfCcsIGl0ZXJhdG9yX3RvX2FycmF5KCRmb3Jtcy0+Z2V0SXRlcmF0b3IoKSkpOyJ9/!HannaCode Code (just for reference): <?php echo implode('|', iterator_to_array($forms->getIterator())); select_form Export string (import this into Hanna Code): !HannaCode:select_form:eyJuYW1lIjoic2VsZWN0X2Zvcm0iLCJ0eXBlIjoiMiIsImNvZGUiOiJcLypoY19hdHRyXG5mb3JtPVwiXCJcbmZvcm1fX29wdGlvbnM9XCJbW19mb3JtYnVpbGRlcl9mb3Jtc11dXCJcbmhjX2F0dHIqXC9cbjw/cGhwXG5pZigkZm9ybSkgZWNobyBcIjxwPmZvcm0tYnVpbGRlclwvJGZvcm08XC9wPlwiOyJ9/!HannaCode Code (just for reference): <?php if($form) echo "<p>form-builder/$form</p>";
    4 points
  2. Maybe I can create a PW site profile based on the default profile with just this module and its required fields and release it here. I think it will be better as I may have a lot of details to explain in text and using code is easier. What do you guys think?
    3 points
  3. The service seems to be dead. Their site isn't loading. I actually removed the module from the modules directory last week when I noticed this.
    2 points
  4. Hi, I think I found out the problem. The method processInput in ListerProConfig has a redirect at the end of the method, so it never properly completes. I changed the addHook method to addHookBefore and it seems to be working now.
    2 points
  5. i love bringing people together
    2 points
  6. I've done an implementation of "magic link" logins via email on a previous (non-PW) site using HMAC SHA1 to avoid having to store passwords. On an upcoming site, I plan to do a similar thing but using JWTs to encode and verify the data, as it's a better standard than just concatenating a bunch of values
    2 points
  7. Yep, I used Auth0 API for that. In the end, it was simpler than I thought it will be. I can send you the module source code but it's not ready for open source, need documentation and maybe a cleanup. Would you like to do that?
    2 points
  8. That's the main reason I decided to embrace "Passwordless" login. No more support messages "I can't change my password" anymore!!
    2 points
  9. you need to use ->filename instead of ->url $pdf = $homepage->pdf_marketing->filename;
    2 points
  10. Setting the defaultGamma option to 0.5 instead of the default 2.0 seems to have fixed the image quality. $config->imageSizerOptions = array('upscaling' => true, 'cropping' => true, 'quality' => 100, 'sharpening' => 'none', 'defaultGamma' => 0.5); Thanks for the help everyone!
    2 points
  11. @palacios000 - you need the "filename" rather than "url" of the attachment. Also if the files field allows more than one, make sure to do first() etc as well.
    2 points
  12. Code snippets are very hard to read on small screens due to lack of white-space: pre CSS property on <pre> tags. This causes very weird text wrapping. Adding this allows code to scroll sideways, which also preserves the whitespace properly. Here's the problem and proposed change in action Readable on large screens, overflow works ✓ Unreadable on small screens, text should not wrap ✘ Proposal: add white-space: pre on <pre> elements. See it in action 2017-04-05_20-18-03.mp4 (770KB) or GIPHY link
    1 point
  13. This module is just what I was looking for! I'm using it to create links to a file download page, instead of to the file itself, with the 'dynamic options' method. However, although it works perfectly, I'm getting a strange error in the Hanna dialogue modal window (see screenshot): I have tried deleting the file compiler cache, but it did not resolve the issue. Set-up Info: Hanna Code: ver. 0.2.0 HannaCode Dialogue: ver. 0.0.3 ProcessWire: ver. 3.0.58 PHP: ver. 5.6.21
    1 point
  14. And if you want an optimized monochrome version (without the gradient on the inner part of the P), go to https://simpleicons.org/ Maybe this version should also be added to that main repo as well?
    1 point
  15. Hi, https://github.com/plauclair/PW-Branding
    1 point
  16. I dig that! Let me find some time to put things together and we'll talk, ok?
    1 point
  17. The thing is, I don't know how but I can access the user dashboard on my free plan. Maybe when I signed up, they gave me access to it. BUT it's not something you will really need because you can manage the users on PW's admin just fine. The dashboard is useful for projects that don't have an admin, I think.
    1 point
  18. There's a lot of thinking behind the magic link solution, the guys at Auth0 handle all the heavy load of checking and trust the user signing. I won't dare to implement such feature myself if I were you. That's a LOT of time to invest.
    1 point
  19. no worries, interesting to know whats out there etc
    1 point
  20. Sorry @benbyf for hijacking your thread, it wasn't my intention. I do not think Auth0 should be part of your profile/module, since it is a paid service.
    1 point
  21. You definetly have to check the user rights. If you prviously used apache module, and afterwards changed to cgi mode, I bet that this are different users on the server. Common usage on shared hosts is, that php as apache module is a user something like wwwrun. As cgi version, mostly it is identical with your own ftp user. So, after you switched to cgi, all messages that say you don't have the access rights to the assets directory totally make sence!
    1 point
  22. You mean Auth0? How about you join forces and release a module? I would love to help by testing
    1 point
  23. Here are some links that should give you some insight to where CSP is at: https://www.w3.org/TR/CSP2/ http://caniuse.com/#feat=contentsecuritypolicy2 https://content-security-policy.com/ https://www.keycdn.com/blog/http-security-headers/ Microsoft - https://docs.microsoft.com/en-us/microsoft-edge/dev-guide/security/content-security-policy Google - https://developers.google.com/web/fundamentals/security/csp/ Mozilla - https://hacks.mozilla.org/2016/02/implementing-content-security-policy/ https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP Opera - https://dev.opera.com/extensions/architecture-overview/ It is also known (reported) that Safari may not be so CSP compliant. I don't believe that Apple has an official Content Security policy. Best Regards, Charles
    1 point
  24. Hi @abdus. You are good to go actually. The argument is required only when there is an exclamation mark after it. It does not have to be = false. Sorry for the confusion, the way I explain it in screencast is a bit misleading. To sum it up, if there is an exclamation mark "!" at the end, it means it is required, of not then it is optional. The = false part means, the default value is false. I know, it sounds stupid. It was a bug in the library I used for this module. I updated it to the latest version since the screencast and now it shows correctly. The = false part is actually is a bug in older version of the module. You probably installed the latest version which shows correctly. So, your version is actually is the way it supposed to be. The version in the screencast is a bit misleading, but still correct.
    1 point
  25. You need to set the page name for the homepage specific to the language.
    1 point
  26. @Sevarf2 this may help you:
    1 point
  27. Thanks @diogo for this. ___________________________________ Get Assignment help.
    1 point
  28. By default PHP's bundled GD 2 library is used. If you're using a recent ProcessWire 3 version, ImageMagick is also supported (if you can have it installed on your server of course). Perhaps you could have better results. https://processwire.com/blog/posts/processwire-3.0.10-expands-image-resize-options/ NB: in /wire/config.php you can also see some settings, copy them to /site/config.php and modify them...
    1 point
  29. You could hide the children/child pages and use the include=hidden selector: children("include=hidden") You could use http://modules.processwire.com/modules/batch-child-editor/ (or http://modules.processwire.com/modules/process-batcher/) to hide them quickly. If needed, you could create a checkbox field named redirect_to_the_parent_page, redirectToTheParentPage, parent_redirect, parent_page_redirect or whatever, add it to the template of the children pages, and add something like this to the bottom of the children pages template file (I have never used it but have just converted it from the code in the NB:, so I haven't tested): <?php if($page->parent_redirect) $session->redirect($page->parent()->url); // Parent redirect if the checkbox is checked ?> If needed, you could perhaps also use something like (haven't tested): <?php if($page("template=children_template")) $session->redirect($page->parent()->url); ?> <Last edit>: I guess <?php $session->redirect($page->parent()->url); ?> // I can't find the code button... would be enough if you put it in the childen pages template file. </Last edit> NB: sometimes I use <?php if($page->first_child_redirect) $session->redirect($page->child()->url); // First child redirect if the checkbox is checked ?> in a parent template file. PS: you also have http://modules.processwire.com/modules/process-jumplinks/, in case.
    1 point
  30. When I go to GraphiQl interface, selector argument for template fields does not appear to be optional as it's in the screencast. However, if I provide a selector, it works as expected. Do I need to set up something on backend? How it looks on my GraphiQL: How it is in the screencast
    1 point
  31. @Nurguly Ashyrov Hi, is there a way to add images/files to a page with the updatePage method ? If not, do you plan to implement it or do I have to do this another way ? Thanks again
    1 point
  32. You have an option, don't call getScriptMulti(); function. <?php if(modules()->isInstalled('MarkupGoogleRecaptcha')) { echo modules()->MarkupGoogleRecaptcha->getScriptMulti(); }; ?> Write your own javascript by referencing getScriptMulti(); function. public function getScriptMulti() { $return = "<script type=\"text/javascript\"> var onloadReCaptchaCallback = function(){ jQuery('.g-recaptcha').each(function() { var _this = jQuery(this); var recaptchaID = _this.data('id'), hl = _this.data('hl'), sitekey = _this.data('sitekey'), theme = _this.data('theme'), type = _this.data('type'), size = _this.data('size'), index = _this.data('index'); if(recaptchaID !== undefined) { var recaptchaWidget = grecaptcha.render(recaptchaID, { 'hl' : hl, 'sitekey' : sitekey, 'theme' : theme, 'type' : type, 'size' : size, 'index' : index }); grecaptcha.getResponse(recaptchaWidget); // grecaptcha.reset(recaptchaWidget); } }); }; </script>"; $return .= "<script src='".self::SITE_RECAPTCHA_API_URL."?onload=onloadReCaptchaCallback&render=explicit' async defer></script>"; return $return; }
    1 point
  33. I'll have a look on the above issues/requests later, nowadays I'm busy with a 4.04 kg newborn who thinks he can steal all the hours in a day (and night)
    1 point
  34. Yeah, it would be a good idea to make a cheat sheet on these hidden "shortcuts".
    1 point
  35. YES. YES. YES. I can't wait to try this on my latest project
    1 point
  36. it's a really amazing module, and will be indispensable for any site using hanna codes, i can already see this solving major problems with users entering incorrect stuff into their hanna codes. the options and description stuff is also amazing work!
    1 point
  37. One of my older module just got some love! So, just wanted to mention that the Module was updated to v2.0.0 with some changes. 1. Its now compatible with PW2.4+ and PW3+. 2. Some changes were made to how it works. It was replacing core function to create the page list labels thus some newer features were missing. Which was kinda pain in the ***. Now it's just hooking after and prepends the image. Done. 3. It also now is not enabled/configured through the template custom label anymore. You can configure templates via a textfield on the modules configuration screen. Just enter template names along with the image field you wish to use: basic-page,image Or basic-page,image.landscape document1,image.portrait 4. It now supports also FieldtypeCropImage (v1) FieldtypeCroppableImage (v2) FieldtypeCroppableImage3 (v3) ... Thanks @adrian for the patience to fix some old problem, and give a hint at new PW3 menu issue. Strange looking at it after years
    1 point
  38. Thanks for these thoughts. They are almost the same, what I wish for the comments module.
    1 point
  39. Merry Christmas to everybody. (Missing Christmas Emoticon) The JavaScript File: $(document).ready(function() { // instantiate WireTabs if defined $('body.hasWireTabs #ModuleEditForm').WireTabs({ items: $("#ModuleEditForm > .Inputfields > .InputfieldWrapper"), }); }); The Module: <?php class ModuleSettingsTab extends Process implements ConfigurableModule { /** * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'Module Settings Tabs', 'version' => 000, 'summary' => 'Provide Tabs for module settings screen' ); } public function __construct() { $this->wire('config')->scripts->add(wire('config')->urls->ModuleSettingsTab.'ModuleSettingsTab.js'); } /** * Initialize the module * */ public function init() { } /** * Module configuration * */ public function getModuleConfigInputfields(array $data) { wire('modules')->get('JqueryWireTabs'); $inputfields = new InputfieldWrapper(); $tab = new InputfieldWrapper(); $tab->attr('title', 'Settings'); $tab->attr('class', 'WireTab'); $markup = $this->modules->get('InputfieldMarkup'); $markup->label = 'Settings'; $markup->value = '<p>Just a placeholder for some inputfields.</p>'; $tab->add($markup); $inputfields->add($tab); $tab = new InputfieldWrapper(); // $tab->attr('id', 'ext_settings'); $tab->attr('title', 'Extended Settings'); $tab->attr('class', 'WireTab'); $markup = $this->modules->get('InputfieldMarkup'); $markup->label = 'Extended Settings'; $markup->value = '<p>For very experienced developers only.</p>'; $tab->add($markup); $inputfields->add($tab); return $inputfields; } }
    1 point
  40. I'm mainly thinking about the way ProcessWire makes it possible for third party modules to alter the source of a page, inject their own scripts or styles, etc. While this does require a lot of trust in installed modules, it's also something we wouldn't want to disallow. Inputfields are another thing consider: many third party inputfields rely on existing libraries, in which case the implementation details are more or less out of our hands. Unless I'm missing something obvious, CSP would mostly be useful if users were able to inject their own scripts or styles for other users to see. In order to do that, you'd either have to be a superuser and use some rather specific features to achieve this, or exploit a third party module that allows this. Latter option is absolutely something to consider, but the first one not that much: generally speaking we consider users with access to the admin interface "trusted"... and superusers even more so. While we could introduce a method of "registering" embedded content with the system, I'm not entirely sure if that's worth it. It could make the lives of perfectly legitimate developers more difficult, while the benefits are — in my opinion — somewhat questionable. It's also good to keep in mind that this isn't something that would protect you from malicious / hacked third party modules: a module could simply hook into an earlier (or later) point in program execution and override any CSP rules you've got in place. That being said, I'm not against the idea of implementing this as a configurable option. It would no doubt be possible for ProcessWire to generate nonces for any inline content it requires, and as long as this would be a configurable setting, it shouldn't come as much of a surprise if some third party features stopped working afterwards. I don't see this as such a big thing and I'd imagine the potential use cases to be limited, I for one would be OK with this as long as it doesn't needlessly complicate things ?
    1 point
  41. Hello, I'm getting this exact error after launching a site using 2.6.1 for the first time. I ran the site through Xenu link checker to try and trigger the error message, but it ran fine, suggesting to me that the problem doesn't lie in the site templates. The System Notifications module appears to create a table in the database called field_notifications, which holds the data that is used for the notifications. It would appear that the error is being caused by a 404 error trying to be added to this table without a unique pages_id and sort. 41 is the superuser ID I believe. So essentially what is happening is the system is trying to add another record (pages_id = 41, sort = 0) when it already exists. However, I can't seem to replicate this however many times I generate a 404! Any ideas what might be generating the 404 that is causing the error? (PS - Going to disable the 404 notifications for the time being)
    1 point
  42. It's like it's mentioned in the error message. There's already an entry with the primary key 41-0 in any of your tables and some code is trying to save another entry with this primary key to this exact same table. For me this error was most of the time caused by (own) modules, which did stuff they weren't supposed to do. But basically you could also just search your site folder for "->save(" as this is the part which will result in the error.
    1 point
×
×
  • Create New...