Jump to content

Martijn Geerts

PW-Moderators
  • Posts

    2,769
  • Joined

  • Last visited

  • Days Won

    31

Everything posted by Martijn Geerts

  1. I'm trying to download my lastest 2 modules within the admin from the Admin > Modules > New The module interface finds a wrong url for both the modules (note the missing master in-front of .zip) https://github.com/Da-Fecto/FieldtypeJson/archive/.zip https://github.com/Da-Fecto/FieldtypeSelectFile/archive/.zip What did I do wrong ?
  2. Can WillyC do the sub titles then ?
  3. Tnx for your good response here bwaked, really appreciated...
  4. Wished I was there awesome list of people, only 50 minutes driving from here. Have fun!
  5. @bwaked: Your topic starts with about script optimising, quality answers are given. Then you start a whole other topic about assets loading. A good discussion comes out of this. Then out of the blue you switch to PHP include performance. For PHP functions and stuff, there's google to find valid answers to your PHP questions. I'm sorry, we are not Stack Overflow. We are the ProcessWire forum. We as developer all have to learn. We all have to search or test for the answers we need. It's just to easy to ask all questions and letting other people answer/work for you. Then you're not letting me know that you're picking up these answers, there's not much response. Lack of PHP knowledge on your side, makes it difficult for you to have a clear overview I guess. But PHP can be learned by study. That your part. And then there is the language thing as we both speak better Dutch then English.
  6. ahh.... but then the server has to work, but not sending the results... loss in server resources...
  7. If we talk about requests we talk mainly about round trips. Browser receives HTML -> finds assets ( scripts styles images fonts etc. ) the browser ask a server to serve those -> the browser get them back. Say you've 10 JS scripts, AIOM combines them to 1 saving your site from 9 round trips. This part I don't understand. If the code from your function is cached & served with proper headings, the next time the browser visits the file it'l tell the browser 304. Then the browser will get the file out of the browser cache. ( maybe only the header is send back, (not sure here), but never the whole file )
  8. Just for the 'pietluttige' @return array
  9. A good read about the static keyword.
  10. - right ! I did write a simple module that handles the caches with markup cache & set proper headers. But it's not realy good tested... Davids minimizer is way more tested, and does do aolot more.
  11. I don't have the total overview, but I think yep...
  12. I don't want to be rude here @bwaked but the optimisation you need is studying some basic PHP. I think thats more important then trying to squeez out a few hundreds of a second with methodes you don't understand yet.
  13. You can't use $this in static. Have you tried __("Male"); ?
  14. I do think optimising is not a bad thing at all, but I think it's a little bit of a trend. If the optimising is simple to do like compression With GZip do it. If there's an automated process that caches the compressed results and servers the cached version back with proper headers go for it. Modern desktop browsers can load 6 assets parallel from the same url ( sub domains make an other 6 lanes free etc etc. ), and for mobile it's mostly 2. So bandwidth optimisation depends on platform. Then you have HTML CSS Javascript optimisation. If you break the paint process of the browser, the browser has to repaint the whole site. Javascript is a great behaviour changer of the dom, so if the js changes the positions, size etc etc, the whole dom has to be repainted. The function you have above is a nice function for compression (saving a little on bandwidth), but it has to do it on every request. The expense here is for the server. It'l do fine if you don't have to many visitors I guess. A minimise function should contain 3 basic things if you ask me: 1.) The minimizer 2.) Caching from the minimised. 3.) Send proper headers, while serving or not serving the cached results back. But for little sites, with not much traffic a few kb more isn't a problem I think. In perspective, if you optimise 1 not optimised image you save way more KB's. I do think if you have 3 or 4 js files, concatenation isn't a big concern. Say if you have 7, 8 or more you could look at Davids minimiser.
  15. Fun read while drinking coffee
  16. Optimising for performance means more server-side code and less client-side code & assets in lot's of cases. Have you so much traffic or so many CPU/Memory expensive processes running that optimising is needed ?
  17. Damn, I can't like my own post
  18. Just A guess... The user template doesn't have a title and PageAutocomplete uses title to find the pages.
  19. FieldtypeSelectFile & InputfieldSelectFile Inputfield Select File is an Inputfield & Fieldtype to select a single file or folder and stores the name and / or use the selected file as page template. The last option enables the editor to use multiple views for a page, depending on the selected template. Settings The folder containing the files and/or folders.A relative path relative to the /site/templates/ folder. Hide file extensions Hide files Hide folders Natural Sort (Select options)Sort files and folders in natural ordering (PHP >= 5.4.0) Change Page Template Just before the Page::loaded event the selected file is set as template file for the page. This setting can only be applied once per a page and folders are exluded from the select inputfield. Note that a page with no associated template file will render with the selected file. When to use ? Let editors select a file and base your own logic upon this. With the change page template setting you're able to use the selected file as template file. This could reduce the amount of normal templates needed and let editors choose how the page get rendered. There are plenty of use cases for this Inputfield. In the examples I call the field selected_file. // let the editor choose a CSS file $config->styles->append($config->urls->templates . "styles/" . $page->selected_file); /** * advanced usage example * * You need multiple ways to render your markup. Let the site editor choose which * file the page need to render. * */ $tpl = new TemplateFile($config->paths->templates . "includes/" . $page->selected_file); $tpl->set('current', $page); $markup = $tpl->render(); (It could be a real good companion with InputfieldSelector) Download at GitHub Modules directory
  20. This week updated MacOSX to work with Atom at work. Working at home with Atom for a few days & now I'm able to use it in the company. I love this new editor !
  21. Stupid me, I was searching the net to the exact prefpane you're linking to [RCDefaultApp] Works great BTW.
  22. Wow... I'm first ! Great Field !
  23. Please re-read the posts... The function is the actual PageArray... Look at Diogo's example how useful a function can be. Why not ? You can get variables inside the function if wished, again look at Diogo's example. You have to use wire('pages'), wire('page'), wire('config'), etc. etc. inside functions because of variable scope.
  24. Do you foreach $selects from the function? If so that not accessible outside the function.
×
×
  • Create New...