Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/07/2017 in all areas

  1. Interesting read and a very nice PW site: https://www.ancientworldmagazine.com/dev/blog/built-using-processwire/
    10 points
  2. Very good article. I also like how they don't hide information regarding developing this website, to include both a Changelog and Roadmap section under their "Dev Index" https://www.ancientworldmagazine.com/dev/
    7 points
  3. We have been patient and we have been accommodating with this thread. However, it has now reached a point whereby this thread is no longer constructive and therefore it has been closed.
    7 points
  4. This is why I love Proccesswire community, I have received a lot of useful answers. My needs are very simple, so I'm using this: http://vinceg.github.io/twitter-bootstrap-wizard I'm working in building the repeaters and the questions at this time. Thank you!!
    5 points
  5. You would think this would work, but if you test it I think you'll find that individual keys set like this have no effect. However, Ryan recently alerted me to this working alternative for setting individual keys: $config->imageSizerOptions('cropping', 'north');
    4 points
  6. I recently started to build Vue SPAs with ProcessWire as the backend, connected with a REST API. Thanks to code and the help of @LostKobrakai (How to use FastRoute with ProcessWire) and @clsource (REST-Helper) I got it up and running pretty quickly and now have put all of it in a site profile for others to use. It includes the REST API with routing for different endpoints, JWT Auth and a simple Vue SPA which shows the process of logging in a user (nevertheless, you don't have to use the Vue part, the API will work on it's own). Check it out here: https://github.com/thomasaull/RestApiProfile I'm pretty sure, it's not the perfect or most sophisticsted solution, but it gets the job done for me… Feedback or Improvements are very welcome Update: This site profile is a module now: https://github.com/thomasaull/RestApi
    2 points
  7. The module is updated : - fixed ProcessDuplicator - packages listed in ProcessDuplicator are now blended and re-ordered correctly by timestamps @msavard Hi and welcome here! About your issue, it is hard say without furthermore information. It can be a memory issue or a timeout issue. Which version of ProcessWire / PHP are you trying to run Duplicator on ? Which hosting provider are you using ? Are you on vps, shared host ? Could you check the duplicator log (in /site/assets/logs/duplicator.log), the server and PHP error logs ?
    2 points
  8. Some backgrounds about the wp-login Jonathan mentioned you'll find here: https://processwire.com/blog/posts/optimizing-404s-in-processwire/ A must-read IMHO.
    2 points
  9. @flydev - this might save you some time: https://github.com/adrianbj/TracyDebugger/blob/c6335760db5467fe018a30c853abf7d4c1c6c967/panels/ProcesswireInfoPanel.php#L288-L306 It provides other options for detecting mod_rewrite, but might also be helpful for mod_userdir
    2 points
  10. They are different beasts, but you can get the label like this: $page->table_name->getLabel('select_field_name');
    2 points
  11. Yes sure, but still adrian was asking how mod_userdir may affect other modules. Where normally http://mydomain.com/processwire maps to /myfilesystemroot/processwire http://localhost/~theo/pwdev/processwire/ does not follow the same rule: /myfilesystemroot/~theo/pwdev/processwire/ is not a valid file path. This should be: /myfilesystemroot/pwdev/processwire/
    2 points
  12. It return an URL, not the path In this case, the URL of your admin page which is valid. @adrian I think I already tried but not in depth to blend them. I will look at it more closely, its definitely a good idea.
    2 points
  13. Just another way in case someone finds this thread and needs an alternative HTML output. There's also a 'currentItemClass' setting which I had to use when I had this exact same problem, those spans being in there were an issue. With an active class on the list item or the anchor tag they are unnecessary. I tried to find a way to just remove them but ended up doing this instead. Also using BS4, except I did it like this (using BS4 variables + extending a custom border class): <div class="pager-nav pb-5"> <?php echo $entries->renderPager(array( 'nextItemLabel' => "Next", 'previousItemLabel' => "Prev", 'listMarkup' => "<ul>{out}</ul>", 'itemMarkup' => "<li class='{class}'>{out}</li>", 'linkMarkup' => "<a href='{url}'>{out}</a>", 'currentItemClass' => "active" )); ?> </div> and the styles: .default-border { border: $border-width solid; border-color: $card-border-color; border-radius: 10px; } /* Pager */ .pager-nav { display: flex; justify-content: center; ul { display: flex; list-style-type: none; margin: 0; padding: 0; @extend .default-border; li { flex: 1 1 auto; &.MarkupPagerNavFirst a { border-radius: $border-radius 0 0 $border-radius; } &.MarkupPagerNavLast a { border-radius: 0 $border-radius $border-radius 0; } a { font-weight: bold; font-size: $font-size-base * 0.9; color: $gray; background-color: $white; display: block; padding: 0.5rem 1rem; } &.active a { background: $main-color; color: $white; } } } } ...outputs: ...html output: <div class="pager-nav pb-5"> <ul> <li class='active MarkupPagerNavFirst MarkupPagerNavFirstNum'> <a href='/processwire-tutorials/'> <span>1</span> </a> </li> <li class='MarkupPagerNavLastNum'> <a href='/processwire-tutorials/page2/'>2</a> </li> <li class='MarkupPagerNavNext MarkupPagerNavLast'> <a href='/processwire-tutorials/page2/'>Next</a> </li> </ul> </div> It's a different approach so I think it's worth sharing.
    2 points
  14. I have heard alot about Django from a mentor, from what I hear it's actually quite a robust solution, so to be honest am a fan of use what's right , I don't subscribe to using Processwire for every type of application most times, I might find myself using Symfony for certain projects because of the flexibility and proper architecture that requires me to handle things and remove certain bundles , but I mostly use Processwire to build sites I want clients to manage, the moment an application has so many custom and specific needs, I would use an application framework, now if I were in Python world, because I don't really like Python i'd use Django for Site management but would prefer to use something light and flexible. Also I think you should state views without insulting, calling people "Fanboy" is not the right approach all the best
    2 points
  15. I do it differently, I use the google recaptcha module here - can install it via classname (MarkupGoogleRecaptcha) in the admin (modules page). So, in my form at the top (where you include valitron): $captcha = $modules->get("MarkupGoogleRecaptcha"); ...then to render it, just: <label for="recaptcha">Recaptcha (required)</label> <!-- Google Recaptcha code START --> <?php echo $captcha->render(); ?> <!-- Google Recaptcha code END --> ...and to check the response: if ($captcha->verifyResponse() === true) I found this way easier. You fill out the secret key and stuff in the module instead of pasting it into your php file.
    1 point
  16. Like you, I've tried lots of different compression techniques. Seems Google only likes its own compressed files. What I do to get the scores up... 1. Run the test then download the zip containing the compressed images generated by Google Page Speed Insights and expand the file 2. Upload the images to the assets/files/[page#] directory and overwrite the images generated by PW 3. Run GPSI again and your score will soar It's not a long-term answer but helpful in development.
    1 point
  17. Great. I didn't really understand what it is doing anyway. The fact that mod_userdir is installed, does not mean, that it is actually used. Thank you.
    1 point
  18. Hmm, there is a little regression on a free webhosting platform I am using: Fatal error: Call to undefined function apache_get_modules() in /users/pwdev/www/site/assets/cache/FileCompiler/site/modules/Duplicator/ProcessDuplicator.module on line 250 The module worked before on this host, but not any longer in version 1.1.4 http://phpinfo.square7.ch/ Thank you.
    1 point
  19. If you're on a mac, - CMD+Shift+3 will screenshot screen and save it on the desktop - CMD+Shift+4 will let you select area and save it on desktop (while dragging use Alt and Shift for additonal control of area selection) + additionally hold "Ctrl" to have it in clipboard to paste somewhere. (you can even paste it directly into this forum editor)
    1 point
  20. Was just thinking how Wordpress does it. Although I am totally against Wordpress their media manager is good.
    1 point
  21. If you're running AdminOnSteroids I think you can do it there as well.
    1 point
  22. I see the problem too and fully agree on you observations. I think I will follow your advice on the questions. I will make my own custom lister. The big horizontal scrolling doesn't worry me as much, the main features I want to take from the listers are the filtering , the CSV export and the "bird eye" view it gives, so those features I think I can handle in a Process module to keep the data structure maintainable which is what in the end worried me the most haha Thanks again for the help!
    1 point
  23. I guess I don't actually understand why $this->config->urls->admin . 'setup/' isn't working. It seems like a valid url and I don't understand why the full http:// url works. As for httpAdmin - any of the config->url options can have the http prefix and they will work - very handy!
    1 point
  24. I was going to post it as the result is weird normal..., but didn't knew about httpAdmin ! I am so tired...
    1 point
  25. https://www.blue-tomato.com/blue-world/ Everything under /blue-world/ is from Processwire
    1 point
  26. I've been googling around and found these two as well: surveyjs Multiple Choice Quiz Engine
    1 point
  27. You may want to look at the field that has Page Autocomplete as the input and see how it's configured.
    1 point
  28. Never saw this issue with a FTP server, maybe its a specific settings of the server ? Do you have good results uploading a conventional file, like a "foobar.txt", an image or even a zip file ? I think I found the issue, it has nothing to do with server, I am dumb. I will push a fix. If I have the time, i will upload the SDKs tonight - I have to update and test them before. --- I can confirm this issue as I could reproduce it right now, I will find a fix.
    1 point
  29. Thanks @flydev for your work on this module. I keep getting the following error when trying to use FTP: "[FTP] error: invalid file 2017-12-04_07-01-36-glosas.anle.us.package.zip, bad extension" I don't understand what "bad extension" means. I've tried leaving the Name field for the backup file blank (default state), and changing it also (which by the way seems to have no effect), but I get the same error. Another question: are you going to upload the Google Drive SDK? I get a 404 error when clicking on "you can download it here..." Thanks.
    1 point
  30. Thanks to you for reporting it back. I will test it on a server with mod_userdir installed today.
    1 point
  31. Yes, and I can tell you that it works, when I configure a virtual host in Apache and add "127.0.0.1 pwdev.ch" in the hosts file. <VirtualHost *:80> ServerAdmin some@some.ch ServerAlias pwdev.ch ServerName www.pwdev.ch DocumentRoot /home/theo/public_html/pwdev </VirtualHost> Then running under http://pwdev.ch/processwire/ everything is fine. So it has to do with mod_userdir. Thank you.
    1 point
  32. Hi @theo , curious to know what you get when outputing something like echo "<pre> path {$config->paths->templates} url {$config->urls->templates} ";
    1 point
  33. First one...you could build a tree branch like: -questions_options --yes --no --don't care --could be changed...later and use a reapeaterfield for your questions...so you can "use" this kind of quiz on every page/template you need it... in the repeaterfield you setup your questions in the simplest mode with a textfield and a pagefield (using the question_options childpages...) to set the right answer - rendering on frontend is obvious with a simple foreach i think. tricky would be to save the entries from users....this would be more complex...;)
    1 point
  34. Yep @ryan's method working perfect. $config->imageSizerOptions('cropping', 'north'); $config->imageSizerOptions('sharpening', 'none'); $config->imageSizerOptions('quality', 80); $config->imageSizerOptions('defaultGamma', -1);
    1 point
  35. I just test it too and it doesn't work. I will try Ryan's method.
    1 point
  36. Does this help? http://modules.processwire.com/modules/import-external-images/ I feel like it would be nice to also have the option to paste in a URL to an image directly into the images field as well though - maybe it could be extended?
    1 point
  37. hmm, if you mean "moving" = moving image from image field A to B (and deleting the image from the source field A), I wouldn't know. But if you mean "moving" = duplicating an image from image field A to B (leaving the source image in source field A), then simply right-clicking on the source image, copy the image URL, and adding it that way would work. (at least with a really quick test on Chrome / Win) Not sure what the big picture in your scenario really is though...
    1 point
  38. I know this post is old, but I would like to revisit this discussion. I would like to implement the static file caching https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess using a similar technique https://nystudio107.com/blog/simple-static-asset-versioning This covers caching theme assets(theme js, theme css, theme images) really well, but how do we handle making sure that links to user uploaded files(ex. pdf files) within our webpages always show the most current version when caching is available? We don't want any existing internal/external links to our pdf documents break. If I upload and replace a privacypolicy.pdf to my page, I can't wait a month or a year before the cache expires before the website user will see the new updated pdf. How do you typically handle that problem? Maybe there is a way to only cache your theme's files, but not your user uploaded files?
    1 point
  39. On a sidenote jwt is perfect when things need to "scale" (i.e. in a microservice architecture). Just share the secret across multiple instances and you don't have to care about syncing sessions and related data. The backend thus can be "stateless" (regarding logins) and just used to deliver data.
    1 point
  40. I think comparing PW to Django is like comparing PW to Laravel. They are different beasts with different use cases. All of them are Awesome (Althought I prefer Flask, Yarrrg for pirates!) Maybe comparing PW to https://wagtail.io/ or https://www.django-cms.org/en/ could be more fair since they are CMS just like PW is. I think the bottom line of chosing a toolbox is down to simple questions: 1- I like using it? 2- What use cases can I fulfill? 3- Makes my team and clients happy to work with? So just use what is best for the requirements, restrictions and overal context of the project at hand. Not all projects can be done with Laravel, Django or PW. Maybe you can mix both and have the best of them :).
    1 point
  41. Damn! I've been away from writing in the forum for so long, and now I'm being pulled in by another stupid discussion... @codelearner If you like Django so much, I can't honestly think of a reason why you're not at their forum instead... can you explain? Are you here because you're seriously interested in PW? Than open your mind, people at this forum have a lot of knowledge to share and they will do it in the most friendly way you've experienced on the internet. If you just want to pick a fight please go somewhere else, Reddit would be a great place to start.
    1 point
  42. Perhaps if you could give us solid reasons why Django is superior we could have a reasoned discussion. We might even be able to learn some valuable things that could be incorporated to improve ProcessWire, but unfortunately you are only providing responses like: "Only 3 lines of code in Django" If you actually want a reasoned discussion, please ask reasonable questions and provide reasonable arguments for your own opinions. Otherwise there is no point continuing this discussion. Thank you.
    1 point
  43. What are you doing here then? Go use django, we wont stop you.
    1 point
  44. 1 point
  45. Please grab the latest version (1.1.1) and test. reSmush.it has no support for svg, so you must use web server tools, aka sudo npm install -g svgo. I tested here on windows and included svgo.exe binary that add 8 MB to the download size.
    1 point
  46. $tmpDir = new WireTempDir('someName'); // add files $fileBasename = 'basename.ext'; $filename = $tmpDir->get() . $fileBasename; file_put_contents($filename, base64_decode($b64Data)); $page->files->add($filename); // repeat for all files ... // optionally, at the end call $tmpDir->removeAll(); EDIT: Ah, you already know / found WireTempdir() EDIT2: If one use WireTempDir for very timeconsuming tasks, one optionally can define a maxAge for it, different than the default 120 seconds: $tmpDir = new WireTempDir('someName', array('maxAge' => 300));
    1 point
  47. PageImage Manipulator - Tips & Examples * how to create a PNG with transparency for the watermarkLogo method If you can use adobe photoshop, you simply may download and install this action: photoshop_action_PW-png-creations.zip create an empty image (transparent, not white or black) of 2000 x 2000 pixel write / paste your text and / or logo in a single color, (e.g. black) when finished with your text you should have one single layer with text on transparent background then click the action PW-png-creations -> 2000px-square-to-smooth and you are done. Hhm, maybe before saving you want to tweak the global transparency of the image a bit. That one used in the ProcessWire example was set to 75% instead of 100%. Just try out what looks best for you. ------------------------------------------------------------------- * did you know that you can save to different file formats, regardless of source format? You only have to specify your desired format (gif, jpg, png) with the optionally options array with a key named outputFormat and pass it with your call to pimLoad() or use setOptions() before any other action-method: // assuming the first image is a jpeg $img = $page->images->first(); // define outputFormat $options = array('outputFormat'=>'png'); // apply it together with other actions $myPng = $img->pimLoad('myPrefix')->setOptions($options)->width(240)->pimSave(); //------------------------------------------------------------------------------------------ // you may also do it as a OneLiner only with the image format conversion $myPng = $page->images->eq(0)->pimLoad('myPrefix', array('outputFormat'=>'png'))->pimSave(); // or you can use the setOutputFormat method $myPng = $page->images->first()->pimLoad('myPrefix')->setOutputFormat('png')->pimSave(); ------------------------------------------------------------------- * (how) can I use the ImageManipulator with other imagefiles than PW-Pageimages? You can load any imagefile from your servers filesystem into the ImageManipulator with: $pim = wire('modules')->get('PageImageManipulator')->imLoad($imageFilename); // or $pim = $wire->modules->get('PageImageManipulator')->imLoad($imageFilename, $options); You can directly with the imLoad-method pass specific $options or you can do a separate call to setOptions(). Then you do your desired actions and last but not least you call save()! Most time I think the original passed file gets overwritten with the manipulation result, but you are also able to save to a different name and / or fileformat. If so, it is useful to get the final (sanitized) filename back after saveing. $optionalNewFilename = $pim->setOptions($options)->height(360)->flip()->blur()->save(); Also you may call this in one line if you prefer: if(false!==$wire->modules->get('PageImageManipulator')->imLoad($imageFilename,$options)->height(360)->flip()->blur()->save()) { // success !! } ------------------------------------------------------------------- * how can I use the PageImageManipulator with my own module/s? If you build a module that do some image manipulation you can define the PIM as needed dependency in your ModulesInfo method with the key 'requires'. You may also force to install the PIM if it isn't already with the key 'installs': public static function getModuleInfo() { return array( // ... 'requires' => array('PageImageManipulator'), 'installs' => 'PageImageManipulator', // ... ); } detailed infos are here: http://processwire.com/talk/topic/778-module-dependencies/ additionally, if you need to check if a module dependency has a minimum version number, you can do it in your install method like this: public function ___install() { // check that at least the minimum version number is installed $needed = '0.0.3'; $a = wire('modules')->get('PageImageManipulator')->getModuleInfo(); $actual = preg_replace('/(\d)(?=\d)/', '$1.', str_pad("{$a['version']}", 3, "0", STR_PAD_LEFT)); if(version_compare($actual, $needed, '<')) { throw new WireException(sprintf($this->_(__CLASS__ . " requires PageImageManipulator %s or newer. Please update."), $needed)); return; } // ... more code } ------------------------------------------------------------------- * global options in site/config.php You can create a config-array in your site/config.php. If you look into it you will find a config array for the ImageSizer that comes with the PW core $config->imageSizerOptions = array( 'autoRotation' => true, 'sharpening' => 'soft', 'upscaling' => true, 'cropping' => true, 'quality' => 90 ); You can define another array with these keys: $config->imageManipulatorOptions = array( 'autoRotation' => true, 'sharpening' => 'soft', 'upscaling' => false, 'cropping' => true, 'quality' => 90, 'bgcolor' => array(255,255,255,0), ); You don't have to specify all of the options. PiM reads the imageSizerOptions and merge them with the imageManipulatorOptions. So if you want to have different values you can specify them in imageManipulatorOptions to override those from imageSizerOptions. Only one option isn't present with the imageSizer: bgcolor. This is only used by the imageManipulator. ------------------------------------------------------------------- * using PiM together with the awesome Thumbnails Module (http://mods.pw/1b) If you use the Thumbnails Module together with PiM, you can set two options in the site/config.php under imageManipulatorOptions: $config->imageManipulatorOptions = array( // ... 'thumbnailColorizeCustom' => array(40,-35,0), 'thumbnailCoordsPermanent' => true ); For the colorize dropdown select you can define the custom color here and with the second param you enable/disable permanent storage of RectangleCoords and params. The coords and params are stored with Thumbnails Module per session, but are lost after the session is closed. If you enable permanent storage these data is written into a custom IPTC field of the original imagefile. ------------------------------------------------------------------- * some more examples will folow here . . . -------------------------------------------------------------------
    1 point
×
×
  • Create New...