Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/31/2015 in all areas

  1. As promised here is the recipe: https://processwire-recipes.com/recipes/inline-critical-css/
    6 points
  2. Hi all, I have send a PR https://github.com/marcus-herrmann/wireshell/pull/1 . You can all play with the branch if you like. EDIT : With respect to feedback and comments : https://github.com/marcus-herrmann/wireshell/pull/2 .
    5 points
  3. Hi guys. This is my first project with PW, my personal site and portfolio. Check it out: http://www.heldercervantes.com This is an almost clean PW installation, with only the file type repeater module for all my repeating needs Had an awesome time with PW and will definitely explore it further on future projects.
    4 points
  4. I have set up a new repo in GitHub with german translation files for ProcessWire modules. https://github.com/Manfred62/pw-modules-lang-de This is a small collection of module translations. Most translations are only "nice to have", because they are for admin use only. Some modules for the use of user/clients or output on frontend are more important to be translated. If someone has translated (german) other modules and like to share them in a central place, post the files here the forum. Then I will upload it to the repo. Afterwards it will be easier to keep them up to date (via forks and pr's). List of translated modules: BatchChildEditor (by mr-fan) CroppableImage DynamicRoles FieldtypeCropImage (Thumbnails) LanguageInstantInstall ImageExtra MarkupWeather (by mr-fan) MarkupYahooWeather ModulesManager ProcessBlog (by mr-fan) ProcessDiagnostics ProcessWireUpgrade RestrictTabView SchedulePages (by mr-fan)
    4 points
  5. Try $pages->find("template=visit-detail, limit=10, sort=sort");
    3 points
  6. So here is the gist: https://gist.github.com/uiii/f1877686bca81fe6d668. See the comment below the gist.
    2 points
  7. Thanks for the remarks. I have to say that working with ProcessWire was nothing short of spectacular. I'm mainly a frontend guy, and the API's simplicity is just perfect for me. Got the site running using only php echos and foreach statements, literally coding it amidst conversations with friends and half looking at my screen. So simple and logic. Plus the barebones + modules approach to the CMS ensures a super clean and streamlined product. No posts module that you don't need, no unnecessary fields, just zero clutter.
    2 points
  8. As I did a lot of performance optimization stuff for a client's website recently I thought I'll share some of my findings: - optimizing for "time to first byte": Apart from fixing performance issues with your php code there is an easy way to "get things started":Chunk your Output! Doing an ob_flush (or {% flush %} if you're using twig) here and there is an easy way to split your page into chunks that are instantly (and in parallel) served to the client instead of rendering the whole page at once. This is especially handy if you're using the next technique: - Inlining "above the fold" content I must admit that I'm not a big fan of inlining things. In my opinion it's against anything I've learned about keeping things "dry, clean and separated". That's why i refused to do it until now. But if you're using grunt/gulp (and especially criticalcss) you're not doubling anything and the inlining is just another task in your gruntfile. There is a pretty easy step by step guide by Jeremy Keith at https://adactio.com where he explains why inlining css on the first visit will gain your site a massive (perceived) performance boost on the first load (this is especially handy on mobile devices). I'll post a recipe to processwire-recipes.com how to achieve this with processwire in the next days - Avoid loading Webfonts directly but do it asynchronous as "Progressive Enhancement" (+ Store them in localstorage to load them super fast afterwards) to avoid blank pages: http://bdadam.com/blog/loading-webfonts-with-high-performance.html Just implementing these 3 (pretty easy) things made the pagespeed score climb up by 15 points and lowered the perceived loading time by at least 2 seconds below the "critical hurdle" of 1-2 seconds.
    2 points
  9. wireshell 1.0.0 is out See Bea's post -------- Original post ----------- Now this one could be a rather long post about only an experimental niche tool, but maybe a helpful one for some, so stay with me Intention Do you guys know "Artisan" (Laravel) or "Drush" (Drupal)? If not: These are command line companions for said systems, and very useful for running certain (e.g. maintenance, installation) task quickly - without having to use the Admin Interface, first and foremost when dealing with local ProcessWire installations. And since it has a powerful API and an easy way of being bootstrapped into CLIs like this, I think such a tool has a certain potential in the PW universe. It's totally not the first approach of this kind. But: this one should be easily extendable - and is based on PHP (specifically: the Console component of the Symfony Framework). Every command is tidily wrapped in its own class, dependencies are clearly visible, and so on. ( Here was the outdated documentation. Please visit wireshell.pw for the current one )
    1 point
  10. Hi Richard, Back when I initially commented on this I had a frontend system for users to edit their profiles. I went that route initially because I didn't want the majority of users to have access to the ProcessWire admin. I quickly abandoned that approach. I found it was easier to create a base level of access to the PW admin that is just for profile editing. Everything else (including the page tree) is hidden. From there I add back the page tree and other resources based on roles. We have 7-8 internal business applications that run on one install. It works really well actually. I can leverage all the power and simplicity of the admin to create things pretty quickly. It's definitely a lot more efficient that creating frontend versions of them. If you really need something that is isolated from your regular PW install, then you could always do what you mentioned above. Setup a separate install and use it like an intranet. You could probably customize the admin theme to make it look/feel a lot like the front end of your site. You could pull in the profiles from one install to the other via services pages module, or some custom JSON. I think there is a relatively new pages to JSON module that looked pretty robust from what I remember. The other option is the full scale frontend approach. It's not that complicated really. User pages are the same as any other page. I think there are some examples floating around the forums already. I'll dig around here and see if I can find the old frontend system I built.
    1 point
  11. I seems that module dosn't work for urls (redirect-from) with UTF-8 characters. This change (adding "urldecode") in file ProcessRedirect.module fixed my problem: public function checkRedirects($event) { $url = urldecode($_SERVER['REQUEST_URI']);
    1 point
  12. Here is my proposal. The HTML is in attachments. There are multiple ways how to install the module. Installing from directory (recommended) -------------------------------------- If the module is uploaded in the official *ProcessWire Modules/Plugins Directory* (http://modules.processwire.com), you can use this method. 1. Log in to your ProcessWire admin and go to the *Modules* page. 2. Go to the *New* tab and expand the *Add Module From Directory* section. 3. Enter the *Module Class Name* (can be found in the module's detail page, e.g. FieldtypeMapMarker). 4. Click the *Download and Install* button. Installing from URL ------------------- If the module is not in the official *ProcessWire Modules/Plugins Directory* (http://modules.processwire.com), but the module ZIP is accessible from URL, use this method. 1. Log in to your ProcessWire admin and go to the *Modules* page. 2. Go to the *New* tab and expand the *Add Module From URL* section. 3. Enter the *Module ZIP file URL* (can be found in the module's detail page, e.g. https://github.com/ryancramerdesign/FieldtypeMapMarker/archive/master.zip). 4. Click the *Download* button. 5. The downloaded modules are now listed on top of the page. Click the install button next to any of the new modules that you want to install. Installing from upload ---------------------- If the module ZIP file is not accessible from web or you have it already downloaded, you can upload the file. 1. Log in to your ProcessWire admin and go to the *Modules* page. 2. Go to the *New* tab and expand the *Add Module From Upload* section. 3. Select the *Module ZIP file*. 4. Click the *Upload* button. 5. The uploaded modules are now listed on top of the page. Click the install button next to any of the new modules that you want to install. Installing manually ------------------- If any of the above methods isn't suitable for you, you can install the module manually. 1. Place the .module file in your /site/modules/ directory. If the module contains more than one file (like supporting .css or .js files for example), it should be created in it's own directory under /site/modules/ with the same name as the module (.module file). For instance, the FieldtypeMapMarker module and supporting files should be placed in /site/modules/FieldtypeMapMarker/. 2. Log in to your ProcessWire admin and go to the *Modules* page. 3. Click the *Check for New Modules* button. 4. New modules are now listed on top of the page. Click the install button next to any of the new modules that you want to install. *Note: All third party modules should be placed in /site/modules/. You might also notice that ProcessWire keeps core modules in /wire/modules/ – You should avoid installing your modules there, as that location is reserved for core modules.* How to uninstall a module ------------------------- 1. Log in to your ProcessWire admin and go to the *Modules* page. 2. Find and click the module name that you want to uninstall. 3. Expand the *Uninstall* section, check the checkbox. 4. Click the *Submit* button. 5. It is now safe to remove the module's files from /site/modules/ if you want to. how-to-install.html
    1 point
  13. Steve, This module is great! I've been using it a lot lately, and just wanted to publicly say thank you!
    1 point
  14. Extremely useful recipe and tips, Felix! I was planning to do that (critical css) for my next project and you just saved me precious time with your recipe. Thank you very much! One more thing I'd like to add is the removing of unused CSS on the whole project, using gulp uncss from Addy Osmani. Especially if you are using a front-end framework (Bootstrap, Foundation etc) or working on someone else's code: https://github.com/addyosmani/gulp-uncss-task You can get a great reduction on your final css file size, even 90% reduction sometimes.
    1 point
  15. Have you tried using the cache fieldtype to combine multiple fields' data into one for things such as searching? It's in the core an Teppo explains it well here: https://processwire.com/talk/topic/5513-fieldtype-cache-please-elaborate/
    1 point
  16. Building one right now. For what Helder did, you could use a pliugin like this http://www.bytemuse.com/Pagify The one I'm building is a bit more complex because the url and the title are updated according to the real url and title of the page using html5 pushstate. In my case I'm using this technique http://rosspenman.com/pushstate-jquery/ There's also this one http://weblinc.github.io/jquery.smoothState.js/ I didn't use because it didn't fit my needs for this site. but looks great.
    1 point
  17. Volvo's solution is custom-built from scratch. At YAP we have our own CMS platform that we've been building and improving over the years. There's a smaller project that I convinced our coders to try out PW and see how it compares to using our own platform. It will be interesting to see how that goes. Oh and thanks for the tip. I just added myself to the directory.
    1 point
  18. cstevensjr,I took your suggestion to tech support @ hosting and it seems like everything works fine! Of coarse it took multiple emails to actually get them to do it Shared hosting as a huge pain but can u beat $70/yr? Thank you so much everybody!!!
    1 point
  19. I think the screenshot won't help anyone debug this. More important would be: which ProcessWire version? any errors javascript and/or php errors? anything in the logs? Also it should not be necessary to copy templates-admin/. Admin Themes should be modules by now.
    1 point
  20. My domain provider just celebrates it's 15th anniversary by providing prices via a game and look what I've managed to win Now I just need to find a purpose for it. If people want to participate in the game, too: https://15.gandi.net/ (Only for customers)
    1 point
  21. @adrianmak, yes it is. I used swiper for the slideshow and built my own way to turn it into a menu of sorts. That way I was able to have deeplinking and make it behave like a multipage sans-pageloads. I also used lazy image loader so all the big images in each project would load only when needed.
    1 point
  22. GPL states that you can reuse any part of ProcessWire for free as long as you're including the license, link to it and you're not charging for it. As your module does not work without ProcessWire itself (not standalone) the part of providing the license text seems to be not that important, as it's in the core installation. With this being said, everything which is not a copy of something in the core is more or less your work / composed by you using the available tools. As a module is always something new to the code the core provides (if not it's not worth publishing) there shouldn't be a problem with copies. For your work you're free to choose any license you want.
    1 point
  23. Great thanks! It seems to work properly now. Yes i have "Rename on save" checked, i forgot to tell. Really thanks!
    1 point
  24. Thanks for debug report - I was able to reproduce the problem here and I have committed a fix. I hope I haven't broken anything else - it's a little complicated dealing with repeaters sometimes Please let me know if it works for you and if you find any other issues. BTW, I am assuming you have "Rename on Save" checked - that seemed to be when the issue showed up for me, although not always. I also improved the behavior for checking existing numbered suffixes on the same main page, so now you won't end up with two images of the same filename, one inside a repeater and one on the main page, which was possible before.
    1 point
  25. On the edit page of the user role, below the checkboxes, it says: To do this, go to Setup→Templates and edit one of your templates. To keep it simple, you may choose the template of your Frontpage, as all other pages will inherit the permissions you set here. In the Access tab, check page-edit for the roles of your choosing.
    1 point
  26. Well the problem was that I didn't use my language name! So now I did localUrl('suomi')); and it works.. sorry for the noise.
    1 point
  27. I am currently managing a PW site with 2 million+ pages. It's admirably fast, and much, much faster than any other CMS we tested. Searching is also ridiculously fast when done on single fields like title. (I also just did a test search using the page finder and it took < 4 seconds to find pages which had a particular field empty from a template which has 1.63 million pages.) The site doesn't deal with many image or file uploads (yet), but two optimizations I have applied so far are to 1) always, always use limits on using $pages->find(), and 2)to cache the sitemaps (which contain thousands of links each) using Procache(https://processwire.com/api/modules/procache/) Once you know where specifically your site is using the most resources, you can apply more selective caching / database optimizations. Thanks for starting this topic, I learned about pageFileExtendedPaths... there's always some cool feature I didn't know about and now must have!
    1 point
  28. 1 point
  29. firstly, note that this my first attempt to make something using php after course in codecadamy.com, also that English is not my first language and I am new to PW i am new to back end web dev and i want to know how to make some basic websites. so i started to play with PW and tried to make some basic things work (btw PW is great). First more problematic thing that i found was how to make forms. like contact forms and so on. here are the problems that i wrote down and tried to find solutions for them: how to make some fields required how to validate some of the inputs if they meet the conditions how to return error message in normal language how to make these errors render like it should in foundation 5 framework ( http://foundation.zurb.com/docs/components/forms.html ) and make it easy how to make some text stay in an input as a value if there was an error somewhere in form. for example if there is a long form and you make mistake in just one field you dont want to make the user type everything again. since i am php newbie it surprised me there actually are php libraries for form validation ... i found valitron http://vancelucas.com/blog/valitron-the-simple-validation-library-that-doesnt-suck/ https://github.com/vlucas/valitron so i thought that it could help. I tried to make it work with PW and here is what i made ... it seems it work it is form.php template... <?php include("./init.inc"); include("./valitron-master/src/Valitron/Validator.php"); // at first i include Valitron. as you can see i copied what i downloaded from github in templates directory... // then i make subclass pwValitron to add some features class PwValitron extends Valitron\Validator { // this function will return 'error' if the field cannot be validated. I use put it in class of particular container. it is bassed on foundation 5 error states public function error_class($field) { if ($this->errors($field)) { return "error"; } return ""; } // this will render error messages. in nice foundation5 style. // $this->errors($field) returns an array of error messages for particular field. public function render_errors($field) { if ($this->errors($field)) { return "<small class='error'>" . implode($this->errors($field), "<br>") . "</small>" ; } return ""; } // this will return a value of particular field only if form caanot be validated because there is some error public function value($field) { if (!empty($this->_errors)) { return $this->_fields[$field]; } return ""; } } // this is how we send data for valitron to validate $v = new PwValitron(array( 'title' => $sanitizer->text($input->post->title), 'email' => $sanitizer->email($input->post->email), 'website' => $sanitizer->url($input->post->website), 'budget' => $sanitizer->text($input->post->budget), ) ); // then we define rules $v->rule('required', ['title', 'email', 'budget']); $v->rule('lengthMin', 'title', 5); $v->rule('email', 'email'); $v->rule('url', 'website'); $v->rule('numeric', 'budget'); $v->rule('min', 'budget', 500); if ($input->post->submit) { if($v->validate()) { // if form is walidated $bodycopy .= "Yay! We're all good!"; //do something with data here } } // now we can write html of whole form // note how I use these ... // {$v->error_class('title')} - will return 'error' and thus add error class only if there is some error // {$v->value('title')} - will return value of field what user wrote if there is an error in form and the form was not submitted // {$v->render_errors('title')} - will render error messages $out = " <form method='post' action='./'> <div class='row'> <div class='medium-8 large-6 medium-centered columns'> <div class='row'> <div class='large-12 columns {$v->error_class('title')}'> <label for='title'>Choose a title</label> <small>it must be 5 or more characters in length</small> <input type='text' placeholder='title' name='title' id='title' value='{$v->value('title')}'/> {$v->render_errors('title')} </div> </div> <div class='row'> <div class='large-12 columns {$v->error_class('email')}'> <label for='email'>What's your email address?</label> <input type='text' placeholder='john@gmail.com' name='email' id='email' value='{$v->value('email')}'/> {$v->render_errors('email')} </div> </div> <div class='row'> <div class='large-12 columns {$v->error_class('website')}'> <label for='website'>Your website</label> <input type='text' placeholder='www.example.com' name='website' id='website' value='{$v->value('website')}'/> {$v->render_errors('website')} </div> </div> <div class='row'> <div class='large-12 columns {$v->error_class('budget')}'> <label for='budget'>What's your budget? (USD)</label> <input type='text' placeholder='750' name='budget' id='budget' value='{$v->value('budget')}'/> {$v->render_errors('budget')} </div> </div> <div class='row'> <div class='large-12 columns'> <div class='text-right'> <input value='submit' type='submit' name='submit' class='button'/> </div> </div> </div> </div> </div> </form>"; $bodycopy .= $out; include("./main.inc"); I would like to know what do you think about it. can it be useful for pw community? is there a better way to do it? can it be made as a module? is there anything wrong? what should be added? Thanks Marek
    1 point
  30. Hi Dave, Welcome to PW and the forums... Glad you sorted it out but would like to suggest you do it differently...assuming I understood the question correctly... If all you want is to grab one random image from a coupon page, there is probably no need to find several pages first. Why not grab ONE random page instead (one containing your coupon images) and display its coupon image? Assuming that a coupon page contains other images as well but you are only interested in the coupon image (i.e. tagged 'coupon'), something like this maybe... //we only get one random coupon page (we use 'get' rather than 'find') $couponimage = $pages->get("template=service-pages, sort=random")->images->getTag('coupon'); Edit: This code assumes there will always be a coupon image in those service pages.
    1 point
  31. Hold the phone... I just solved it! Just had to reverse step two and step three! So Get a random page from the array first, then display the image with the tag of coupon: $couponpages = $pages->find("images.tags=coupon"); $coupons = $couponpages->getRandom(); $coupon = $coupons->images->getTag("coupon"); echo "<img alt='{$coupon->description}' src='{$coupon->url}' />"; Success!
    1 point
  32. I'm not exactly sure what you're thinking "combine" means here, but this field does exactly what the description says; it grabs data from other fields, mashes it all together into one big blob of (JSON) content -- and that's just about it. One very simple (yet sometimes very practical) use case is if you've got, say, 15 different text fields and you need to find pages that contain value "john doe" in any of those. Instead of doing this: $john_does = $pages->find('field1|field2|field3|field4|field5|...|field15%="john doe"'); .. you can create a cache field, select all of those fields to be cached in it, and then do this: $john_does = $pages->find('my_cache_field%="john doe"'); Not only does this look clean, in certain situations it can wildly improve query performance.
    1 point
  33. You have to enable it in your Form Builder module settings: InputfieldFormBuilderFile. On an existing FormBuilder installation, you may have to install the module before you can enable it. The $e['file'] should be an array of filenames. In the case of a single file, it would just be an array of 1 file. The actual file URL is protected from direct access, so you have to ask Form Builder to generate one for you. It's not the prettiest in terms of API access, but I think this should work: $form = $forms->get('contact-form'); foreach($form->entries()->find() as $entry) { foreach($entry['file'] as $filename) { $path = $form->entries()->getFilesPath($entry['id']); $url = $forms->getFileURL($form->id, $entry['id'], $path . basename($filename)); echo $url . "<br />"; } } Regarding submission date, Soma is correct that it would be contained in $entry['created']; as a unix timestamp.
    1 point
  34. You should also be able to grab the last image and add the description to it: $page->images->add($filename); $page->images->last()->description = "description";
    1 point
×
×
  • Create New...