Jump to content


Popular Content

Showing content with the highest reputation on 05/16/2016 in all areas

  1. 9 points
    The new images field looks amazing. Anytime the community requests something, we get something so much better than expected. Reminds me a little of the alleged henry Ford quote. Back to image cropping, most of our sites use CroppableImage. Not having a cropping solution based on pre-sets in PW3 (in-built or non-native) means we can't take advantage of these V3 right now. That's OK-ish as PW3 isn't officially released yet. I do wonder how this will develop. Will native cropping come to V3 soon and if so, will we have to rewrite all our cropping code across every site? $image = $page->images->first()->getCrop('portrait', "width=200, height=200, quality=80"); I think Horst has done an a amazing job with CroppableImage and it's an essential default module for most of us. I completely sympathise with his sentiment that continuing development of CI doesn't make sense when the images field has breaking changes. Anyway, I guess what I'm ultimately saying is +1 for image cropping around predefined presets. A year ago that I proposed something like this (last screenshot) where various preset shapes were displayed alongside the image (and callable via the API). I'm sure there's better ways to achieve this but if Ryan or Horst or Tom needs any extra assistance, I'm more than happy to help with wireframes, mockups, or testing etc.
  2. 3 points
    Version 3.0.18 continues from last week, making major upgrades to our images field. This week we got into some of the finer details, and we've got plenty for you to look at here, as well as a screencast (at the end) to demonstrate it all. https://processwire.com/blog/posts/more-images-upgrades/
  3. 2 points
    Well, it's not THAT easy. Check here: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-elasticsearch-on-ubuntu-14-04 I suggest you read about the way ElasticSearch works to understand what is possible and what is not, and how to adapt it to your needs. It seems easy, but it a mighty thing and as such can easily cause more trouble than it's worth.
  4. 2 points
    So great updates, many thanks for this work! A little cosmetic thing: The size of portrait images In list mode are very large and blurry even with the smallest possible slider setting. Could be confusing for customers. Maybe limiting the longest side of an (portrait) image to a maximum to render it smaller but sharper? Besides that the proportions / sizes of portrait and landscape images are more homogenous to each other. EDIT: Oh, 2 minutes after sending this I found the checkbox "There are older/low quality thumbnail preview images above – check this box to re-create them." So the blurring is gone... sorry. Only the size for portrait images seem too big (for my eyes) – especially if you shrink the viewport – after the break they take a lot of space.
  5. 2 points
    You need to reference the field from the selected page(s). If the page field is set to store multiple pages you usually want to foreach through them: foreach($page->page_field as $pf) { echo $pf->title; } That will return the titles of all the pages selected.
  6. 2 points
    Is this already in, "crop sizes from presets"? If we could have that with the core images field, it would make the croppable images obsolete, what I think would make things much easier. We only would need one images fieldtype and optionally can define "presets" or not. Wouldn't it? +1
  7. 1 point
    I've just added a pull request for a ProcessWire driver to laravel valet: https://github.com/laravel/valet/pull/55/files For anyone wanting to have a quick local dev environment (on a mac) you should certainly take a look. https://laravel.com/docs/master/valet
  8. 1 point
    Hi, I see this module : http://modules.processwire.com/modules/login-notifier/ Written by Mr. Cramer himself. I have not done any coding for user-member/access functionality in Processwire so I can't speak from experience, sorry. I would say that that module by Ryan might contain what you need or at least point you in the right direction. Can't hurt to look. Then you also have the API. - https://processwire.com/api/variables/user/ And last but not least - http://cheatsheet.processwire.com/user/user-methods/user-isloggedin/ Ok.. maybe not the last.. I found this also https://processwire.com/talk/topic/9811-frontenduser-login-logout-and-register-users-members/ . Read the features list. It has functionality to check for a user who is already logged on. Hope the above helps.
  9. 1 point
    Hello Neo, you could approach this different and make the parent page "portfolio" visible. Then you could exclude it from your navigation and search function. At last step you have to exclude it from your XML sitemap. For this I prefer using a fork of the original module by tpr. Another approach could be to create your own XML sitemap, but that needs a little more effort. Regards, Andreas
  10. 1 point
    Hello, This was caused by a ModSecurity rule on the client's hosting environment - more info here: https://www.trustwave.com/Resources/SpiderLabs-Blog/ModSecurity-Advanced-Topic-of-the-Week--Remote-File-Inclusion-Attack-Detection/ Cheers, Chris
  11. 1 point
    I also have an Ubuntu droplet on Digital Ocean. After setting up the free Let's Encrypt SSL certificates, I have activated http/2 and everything runs smoothly. I haven't tweaked my sites to take full advantage of http/2, or run benchmarks to measure improvements though.
  12. 1 point
    The best place to look is here: http://modules.processwire.com/categories/users-access/ I remember there being a module that tackled this issue. Regardless, there are many talented individuals on this forum who should chime in with a solid solution. Good luck.
  13. 1 point
    If you are using a web analytics package (Google Analytics, Woopra, Piwik, etc..) you will see what was typed by the user. I did a quick check with Piwik to confirm this is true. Initial Search on website Search completed (searched word not found) Piwik search results
  14. 1 point
    Hello OLSA, I don't know exactly how the structure of your template folder is, but I had the same error message "Call to undefined function __()", when I tried to use an translatable string inside an php include file like this: echo __("String to translate"); I solved this error by using the $this->_() wrap mentioned in the documentation: echo $this->_("String to translate"); Maybe this will solve your problem. Personally I never had problems with the template compilation, but If you have and want to disable the template compilation, you should be sure to add the ProcessWire namespace at the beginning of your template files. I wouldn't disable the module compilation, because most of the modules aren't yet compatible with PW3 without the module it. If Wamp supports PHP7 you could try if it improves your back end performance. Regards, Andreas
  15. 1 point
    Hi kongondo, Very important update : This module will not work in Processwire 3.0. Main reason being there is no 'namespace Processwire;' in the source., sorry. The module DOES work on 2.7.2. but no dice on 3.0.18. I just happened to update my dev site to 3.0.18 this morning and in the course of doing so, I hit this problem because of the lack of a PW namespace in the module. After adding it, still getting an error on one of the methods that uses Reflectionclass. I am going to try to sort this out. When it's done, I'll let you know. Thanks. =============================================================================================================== update part 2 : I have the module working in PW 3.0.18 now. This has been a learning experience on namespaces. A few problems came up fixing the module, that I resolved, I need to go back and test a bit before I post anything here. This link helped explain what the problem was with trying to instantiate a Reflectionclass object : <http://php.net/manual/en/language.namespaces.fallback.php> The fix was to prefix the classname with a backslash. So changing this line within the FirePhp class : $reflectionClass = new ReflectionClass($class); to this : $reflectionClass = new \ReflectionClass($class);, solved that problem. I want to look into this further. Once I'm comfortable with the fixes, I will update the zip I created. Thanks. update part 3: The dropbox link for updated version https://www.dropbox.com/s/wdhxy1ke1z4rm25/firebugMod_V2.zip?dl=0 ================================================================================================================ Original post before the fun began: Here's the dropbox link to the zip file I put together. - https://www.dropbox.com/home?preview=firebugMod.7z I'm on Windows. I created the zip with 7-zip. I hope that doesn't pose a problem. If it does, let me know please. I did try to make the code a little more presentable. PSR compliant? Probably not but close? lol The zip includes a few things other than the module itself, which I thought my be helpful. 1) There's a read me file of course. It explains how to set up the module. I'm sure you don't need help I wrote it up anyway 2). There's some uber simple examples of calls to the module which I think hit every available function in the module. The module does NOT provide calls for every available feature of Firebug or Firephp, but I do think I included code for the most used functions. 3). There's some example screen prints of the output on the Firefox console. 4) and Last but not Least, there's the Firebug and FirePhp library files which the module pulls in of course. I saved you the trouble of downloading them yourself. I believe they are the most recent versions. I'm on Firefox 46.0.1. I have Firebug 2.0.16 and Firephp I'm not super techy when it comes to Firefox add ons. My concern is how the code with behave if you're not on the same versions. I guess we'll see. I am hoping there won't be issues. I think that is it. Thanks for the interest and have a good one.
  16. 1 point
    Thank you sooooo much! And +1 for Martijn's request
  17. 1 point
    Awesome update! But one feature request: Optional disable crops with flexible widths & heights' and enable crop sizes from 'presets'.
  18. 1 point
    I do not use PW's form markup at all but Nette Form elements. Renderer is easy to customize, eg. $required_asterix = Html::el('sup')->setClass('asterix')->setText('*'); $colon = Html::el('span')->setClass('colon')->setText(':'); $renderer->wrappers['form']['container'] = 'div class="form-wrapper"'; $renderer->wrappers['controls']['container'] = 'div'; $renderer->wrappers['control']['container'] = 'div'; $renderer->wrappers['control']['description'] = 'p class="form-description"'; $renderer->wrappers['error']['container'] = 'ul class="help-block text-danger form-error"'; $renderer->wrappers['label']['suffix'] = $colon; $renderer->wrappers['label']['requiredsuffix'] = $required_asterix; As I wrote modifying the markup this way is well enough for simpler forms, and even for larger forms if there are no fancy things. Here is a quick screencap where I used manual rendering, which allows custom markup. Form fields are defined separately, and you can retrieve the full control, or only the label or control, error parts, etc. I like the freedom it gives. <div class="form-wrapper" n:if="$rsvpForm"> <fieldset> <legend><span><strong>Personal data</strong></span></legend> <p class="checkbox-wrap"> {$rsvpForm[participation_toggle]->getControlPart()} <label for="cf_participation_toggle">We attend the wedding</label> <span class="slideToggle">{$rsvpForm[participation_toggle]->getLabelPart()}<strong></strong></span> <label for="cf_participation_toggle">Unfotunately we cannot attend the wedding</label> </p> <div id="personal_data"> <div> <div class="input-wrap">{$rsvpForm['name']->control->cols(35)} {$rsvpForm['name']->error}</div> <div class="input-wrap">{$rsvpForm['email']->control->cols(35)} {$rsvpForm['email']->error}</div> <div class="input-wrap">{$rsvpForm['phone']->control->cols(35)} {$rsvpForm['phone']->error}</div> </div> </div> </fieldset> ...
  19. 1 point
    Just a quick update on the above in case anyone else runs into problems with this. Having had the solution work for most sites, today I had a persistent "unrecognised HTTP host" message even though config module was uninstalled congig settings were correct caches were cleared etc As soon as I fired up the same site Admin in a different browser, the issue disappeared and I could publish roles etc. In this case it was Google Chromes cache caching my old config files. Over and out !
  20. 1 point
    Since there are a lot of topics about the same theme, I decided to write a small module which overwrites the core function ___SetupPageName(). The module allows now to populate the page name using proprietary date() function. Works like PHP date() with follwing exceptions: Everything between the brackets is detected as format string, meaning no 2nd parameter possible. No need to use quotes around the format string. Spaces not allowed. from any page property, page field including subfields, parent property, parent field etc. Meaning everything what you get with $page->get(); including dot syntax. The function will give error and warnings in case of unproper settings, but creates the page with name 'untitled' anyway. Download here: http://modules.processwire.com/modules/process-setup-page-name/ Some Examples The following settings in parent template 'Name Format Children' will assign name immediately. date(Y) date('Y-m-d') parent.title parent.parent.title parent.id template.id assign name after page saving and/or population of depending field. Overwrites 'untitled' after all fields which are defined in parent template are populated. id (any other page property) pagefieldname, multiple pagefieldnames show a warning. pagefieldname (value not populated)show an error. date() // empty, no format assigned date(Y // missing closing bracket date(Y md) // unallowed space notexistingfieldname notexistingproperty existingfield.notexistingsubfield The function in the module ___SetupPageName() could be completely copied as is to the core class $pages. @Ryan Would be nice to see this in core. Related topics: https://processwire.com/talk/topic/8576-name-format-children/ https://processwire.com/talk/topic/8217-name-format-for-children-based-on-any-field-not-just-title/ https://processwire.com/talk/topic/11628-custom-page-name/ https://processwire.com/talk/topic/11349-page-add-step-not-being-skipped-when-name-format-for-children-is-set/ https://processwire.com/talk/topic/10701-automatic-page-name-using-processpageaddexecute-and-pagetable/ https://processwire.com/talk/topic/10208-pagetable-automatic-page-name-format-when-multiple-templates-allowed/ https://processwire.com/talk/topic/9979-name-format-for-children-for-multiple-allowed-templates-for-children/ https://processwire.com/api/modules/process-template/ Any recommandations after testing welcome. Download here: Download here: http://modules.processwire.com/modules/process-setup-page-name/ Edit: small enhancement to prevent display of warning twice. 23.12.15 multiple values possible now 24.12.15 made compatible with PW 3.x 27.12.15 Update Version 1.0.8 09.01.16 Update Version 1.1.0
  21. 1 point
    Updated my fork to 1.2.6: https://github.com/rolandtoth/ProcessWire-MarkupSitemapXML/tree/master The readme file is updated with info on the new features: auto generate sitemap on module submit ajax button to generate sitemap comments feature in exclude list
  22. 1 point
    Not sure your exact scenario, but I have made use of: $this->addHookBefore('InputfieldPassword::processInput', $this, 'removeRequired'); public function removeRequired(HookEvent $event) { $event->object->required = false; //hack to remove required status on password field } From memory it's not possible to set the status of the password field directly to not required. I know this is not the same as disabled, but now you should be able to disable or hide it and should work as expected I think. One thing to keep in mind, the system password field is actually named "pass", not "password" like you have there.
  23. 1 point
    In case you guys haven't seen it, this might be relevant: https://processwire.com/talk/topic/4544-image-field-changes-file-name/
  24. 1 point
    Just use the wonderful CropImage module. Say, you have a 300x300 image in your template. Define one 300x300 called "thumb" and one 600x600 crop called "thumb2x". Now you can use the picture polyfill like this: <picture> <img srcset="<?= $page->myimage->eq(0)->getThumb('thumb') ?>, <?= $page->eq(0)->myimage->getThumb('thumb2x') ?>, 2x" alt="<?= $page->myimage->eq(0)->description ?>"> </picture> Adding additional breakpoints with <source> is also possible (from the picturefill docs): <picture> <!--[if IE 9]><video style="display: none;"><![endif]--> <source srcset="examples/images/large.jpg, examples/images/extralarge.jpg 2x" media="(min-width: 800px)"> <source srcset="examples/images/small.jpg, examples/images/medium.jpg 2x"> <!--[if IE 9]></video><![endif]--> <img srcset="examples/images/small.jpg, examples/images/medium.jpg 2x" alt="A giant stone face at The Bayon temple in Angkor Thom, Cambodia"> </picture> So you can also do some art direction where you output not only different sizes but also different formats (for example 2:1 on mobile, 1:1 on desktop etc)
  • Create New...