Jump to content

AndZyk

Members
  • Posts

    678
  • Joined

  • Days Won

    10

Everything posted by AndZyk

  1. AndZyk

    Cache

    Strange, that it didn't work for you. Be sure, that your developer tools are open, when refreshing the site. But if the others solutions work for you, than that is fine too.
  2. My only source is PageSpeed Insights and there are two fonts and an external script not compressed, but maybe they slip trough the compression rules: https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fwww.brownhensolutions.com Minifying HTML also helps, but you have to be careful with the rules inside ProCache, if you are using for example SVGs inside your HTML. Compressing images is also worth a shoot. I prefer ImageOptim for that. But your site is already fast. So that would be a nice to have.
  3. Hello @fliwatuet, the easiest way I can think of, is creating three extra fields: Street: Text Postal Code: Integer City: Text And use the existing Map Marker field for storing the geocode. That way you would have to enter the address twice, but you could easily access them with the API. Another approach would be to explode the address of the Map Marker field into an array: $address = explode(",", $page->map->address); echo $address[0]; // Street echo $address[1]; // Postal Code echo $address[2]; // City But that would of course require you to always provide those three values separated by commas. Regards, Andreas
  4. Hello @ethfun, you could define a list of allowed URL segments and then write the logic inside your template, like f.e.: if ($input->urlSegment1 == 'subdomain-one') { // Show first subdomain } else if($input->urlSegment1 == 'subdomain-two') { // Show second subdomain } else { throw new Wire404Exception(); // Show 404 page } If you are using PW3 and are looking for a cleaner way to separate the contents of your subdomains, you may be interested in using multi-instance. Regards, Andreas
  5. Nice looking site. Only thing I noticed is, that your robots.txt contains some PHP: Sitemap: <?php echo "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] ?>sitemap.xml And you could further more improve page speed by enabling compression, if your server supports it. Look in the ProCache settings under GZIP+More for more instructions. It is propably a typo, but it should be $config->urls->templates.
  6. PostCSS looks indeed interesting, especially the Autoprefixer plugin. I am thinking about switching my current workflow (CodeKit + Sass + Compass) to Gulp + Sass + PostCSS, but have to evaluate if it is worth the hustle.
  7. AndZyk

    Cache

    Hello @Speed, when developing in Chrome, you can disable the cache in the developer tools under the network tab or network conditions drawer permanently, as long as the developer tools are open. Regards, Andreas
  8. Hello @thlinna, haven't tried it out for myself yet, but I think @LostKobrakai Migrations module is what you are looking for. Regards, Andreas
  9. I started to get my hands on hooks for the first time and think that Captain Hook (like the Cheatsheet) are great resources. Unfortunately (or fortunately if you want) has the documentation inside the files moved the line numbers of the linked hooks, so that the links on Captain Hook don't point to the right direction anymore. Also they use the old repository. If the links could be updated, that would be great. To be future-proof I saw recently this thread: Maybe with APIGen and the API Reference there is not much need for Captain Hook anymore, but as it is cross linked in many places (f.e. AdminThemeReno), this would be great for beginners like me. Regards, Andreas
  10. Interesting thread and nice picture. Maybe you should make a request for ProcessWire to include more breast hair. In my case, I was introduced to PW by an co-worker who saw, that it won the CMS Critic 2014 Award for Best Free PHP CMS. At this time he was looking for a flexible field based CMS similar to Contao, which we used before. I quickly became a fan, because I only used to know WordPress and enjoyed the freedom I had as an developer + the friendly community. Or like The Hoff used to say:
  11. Hello @adrianmak, you could give $page->hasChildren() an selector, for example: $page->hasChildren("template=home|basic-page"); Otherwise I don't know, if it is possible to tell, if a page was created using PageTable, because it is an regular page after all, as far as I know. Regards, Andreas
  12. Thank you for clarifying. I never developed a module or tried the Smarty for the TemplateEngineFactory module, so I'm not very helpful. But here are some ways on how to bypass the file compiler. Maybe adding // FileCompiler=0 in your module files will do the trick. Also there is a core module File Compiler Tags which is maybe similar to Smarty. As to your question on how to develop modules using an IDE, the latest blog posts could be interesting for you: https://processwire.com/blog/posts/processwire-3.0.39-core-updates/ https://processwire.com/blog/posts/processwire-3.0.40-core-updates/
  13. Hello @floridaDev, if you try to find thousands of pages, have a closer look at the findMany-function. Also can PHP7 boost your performance significantly, if its available for you. Regards, Andreas
  14. Welcome @LimeWub, that is what the module compiler is for. If you are using PW 3.x.x it adds the ProcessWire namespace to the module files to make them compatible with PW3. If you don't want to deal with namespaces there is also PW 2.8.x available. But it is only recommended to use for existing projects. For new projects PW 3.x.x is the way to go. If you want to disable the module compiler, you would have to add the namespace in the module files by yourself to resolve the issues you mentioned above. But do you want to debug modules or are you trying to debug your template files? If that is the case, you could try to disable the template compiler in your config or in your templates. Regards, Andreas
  15. ServiceWorker - Gives websites the power of native apps, like push notifications, background sync and offline experience. Here is an funny and informative introduction.
  16. Your if-statement probably has not worked, because you don't have an input type submit in your form. Instead you have an button with the type submit. Then your original if-statement should work. if ($input->post->submit) { // Form was submitted } else { // Form wasn't submitted } Also I would recommend again to get and sanitize the input from code like mentioned above. Especially if you want to use it as a page name, the corresponding sanitizer is meant for this. You can set a new value for an existing field using the API like this: $p->of(false); // Shortcut for setOutputFormatting(false) $p->set("title", $sanitizer->text($input->post->title)); $p->save();
  17. Your code seems to be right. Only things I would recommend: If you want to use a number as input, there is an input type number for that. You could get and sanitize the input using the API: $code = $sanitizer->pageName($input-post('code')); Have you tried your code with static values without the form? If it works this way, it may be your form. Regards, Andreas
  18. Have you tried the table-option inside CKEditor? I find it really good for simple tables like yours. Just insert a table and anything you need to adjust after inserting can be achieved trough right clicking inside the table (insert, connect etc.). No need for HTML knowledge. For more complex tables there is of course ProFields Table, but for your needs it should be enough. Regards, Andreas
  19. Hello @mangopo, either you can make your existing site responsive using media queries or you can build an mobile version of your site. There are pros and cons for each approach, but I would recommend responsive design over an mobile version. If you want to learn more about this topic, there are many resources available, which explain it in depth: Responsive Design with CSS3 Media Queries Responsive Web Design: What It Is And How To Use It Regards, Andreas
  20. This is just my opinion, as I am working most of the time solo on my repositories. If I would work collaborative on a project I would probably track the database changes too or try the Migrations module.
  21. Not automated, but a great set of resources: Devices by Facebook.
  22. ...Or not deleting this file in the first place. But glad you found it.
  23. Hello @microcipcip, I believe Ryan meant any change of the files. It is not recommended to track assets or uploads folders, because they can easily bloat your commit history and even worse you could grow a repository over 1 GB. Tracking the database would require you to make always dumps of it. Even though you could automate this, I also don't recommend it, because it could bloat your commit history too. If you need inspiration of a .gitignore file, there is a popular GitHub-repository with templates for other systems. Maybe ProcessWire could be added too. Regards, Andreas
  24. That is interesting, because it doesn't show anything at all. If it would be an .htaccess-error, at least an 500 error should be thrown. But it doesn't seem to be, because your front end works properly. PHP 5.3.8 and 5.4.45 are already outdated versions, but they should be supported. Preferably your hoster should offer at least PHP 5.6.x. You can always make sure to have the right PHP version running, by uploading an file f.e. info.php with the phpinfo-function in it. After checking, be sure to delete it, because it offers potential attackers an insight to your server environment. Maybe someone else has more info on this issue. Nice site by the way.
  25. Hello PawelGIX, have you tried to enable debug mode, to see more details? Of course the debug mode shouldn't be enabled on a live site, but you could enable it just for a short time, until you know the issue. Regards, Andreas
×
×
  • Create New...