Jump to content

evanmcd

Members
  • Posts

    117
  • Joined

  • Last visited

Everything posted by evanmcd

  1. Great module. Thanks @matjaz! Looks like https://resmush.it/ is down. Anyone know if the service is still running? I'm thinking it would be good to swap out resmush.it for ShortPixel or TinyPNG as the external service. I'll fork and submit a pull request if I end up tackling that. Anyone else working on image optimization modules like this?
  2. Hi all, I've not been able to upload SVGs into a regular image field, with SVG added in the Valid File Extensions field. The error I'm getting is: Error: Call to undefined function ProcessWire\simplexml_load_string() (line 234 of /var/www/hosts/our_website/Develop/Source/wire/core/Pageimage.php) I tried the ImageRasterizer module, but that didn't fix it. Is there a workaround for folks that don't have the simplexml module installed?
  3. Hi, I'm in the process of moving over some Blogger blogs into ProcessWire. We want the URL format to match what was in place previously, so blogname.com/blog-post-slug/ which would be fine if we just created the posts at the root of the site. The issue is the fact that we have more than 500 posts, which we've setup in a /blog/ folder so as not to clutter the root of the site with a list of posts. I saw this mentioned in another post, but @ryan was not "not confident that PW will be totally happy with it". RewriteRule ^$ /subfolder [L] Is there a ProcessWire core team sanctioned way to rewrite all /subfolder/ URLs to the root? Thanks!
  4. Oh no problem at all @ottogal. Just tried moving the appended region code above my top.php and it worked as @Robin S predicted. Not sure why I didn't just try that before In any case, thanks for the help. I see myself using markup regions with all my sites going forward. So much cleaner that other methods.
  5. Ahhh, sorry, didn't see @Robin Ss post until after I replied. I'll give that a shot. Thanks for the tip.
  6. @ottogal, yes but isn't that the syntax for using markup regions? The 2nd head tag should be removed by PW prior to rendering as I understand it.
  7. Hi all, Just found my first use case for new Markup Regions (at least I think that's what they're being called) feature. Unfortunately, I haven't been able to get it working. I'm using 3.0.57 and have added the $config->useMarkupRegions = true; line to my config file. Next, I put the id in my head tag like so: <html lang="en"> <head id="html-head"> Then the markup in the template file (the head tag is in top.php): <?php include("inc/top.php"); ?> <head id="html-head" class="pw-append"> <link rel="stylesheet" type="text/css" href="/site/templates/css/calculator.css"> </head> When I reload the page that uses the above template, I get that unprocessed code output right after the output of my top.php file - in other words exactly what would happen if there were no such thing as Markup Regions. Am I missing something? I've read through the post here, and I seem to be doing everything needed. Thanks for any help.
  8. I was just going to try this out to setup a test case for a couple core edge-case bugs I want to submit patches for, but I wasn't able to create a site with a new profile, and now even the home page is throwing a 500 error. Hope it comes back up soon - it's a great service for cases just like this.
  9. I'd like to rename Pages to something else and thought I read about a way to do it, but alas I can't find it anywhere on the forum (it's kind of a tough thing to find given that 'change' 'admin' 'pages', etc all have some many other meanings). Of course, I tried doing it right in the Page Tree itself, but the admin pages (once unlocked) throw errors that I didn't quite know what to do with. Thanks to anyone who can point me in the right direction.
  10. This is fantastic Martijn, thanks so much for creating it. Just set it up for exactly the purpose you mention - creating an html email based on content coming from PW. Well done!
  11. Hi, this has been a favorite module of mine, but I'm finding that it doesn't work with v2.5 (specifically 2.5.3). I get this error when loading /setup/selector-test/: Error: Call to a member function getArray() on a non-object (line 700 of /Develop/Source/site/modules/ProcessSelectorTest/ProcessSelectorTest.module) Is there another way to do this using Lister that I don't know about? Thanks.
  12. Thanks Martijn for the great guide. Just wanted to point out that me and my team have used VirtualHostX for years to make managing multiple local hosts easier. It's a bit pricey, but if you work with a lot of local sites it's a huge time saver. https://clickontyler.com/virtualhostx/
  13. Thanks for the responses everyone. Perhaps I wasn't clear enough in my question. Following the server-side detection, I'm redirecting mobile users to an entirely different page. It's not a responsive page for which we are changing the display or structure of the same content on a single page. After thinking about it for a bit, I will say that easy server-side caching is now another pro for a responsive design, but for now the desktop and mobile experiences are different pages. I'll reply back here if/when I come up with a good solution.
  14. Hi, I've come across this issue for the first time and am wondering if anyone else has a better solution than what I've come up with. I have a site that uses PHP to sniff the user agent and redirect if it finds one that matches with mobile. Like this: $iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone"); $ipad = strpos($_SERVER['HTTP_USER_AGENT'],"iPad"); $ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod"); $winmo = strpos($_SERVER['HTTP_USER_AGENT'],"Windows Phone"); $opera_mini = strpos($_SERVER['HTTP_USER_AGENT'],"Opera Mini"); $android_mobile = false; if(stripos($_SERVER['HTTP_USER_AGENT'],"Android") && stripos($_SERVER['HTTP_USER_AGENT'],"mobile")){ $android_mobile = true; } $is_mobile = 0; if($iphone || $ipod || $android_mobile || $winmo || $opera_mini) { $is_mobile = 1; } $is_ipad = 0; if($ipad) { $is_ipad = 1; } if($is_mobile) { header("location: m/"); } However, I'd like to use caching on templates that have this detection and have found (not surprisingly of course) that the redirection doesn't happen when caching is enabled - everyone gets served the desktop content. I could use a JavaScript based solution, but that would not be ideal as part of the page would render before the user would be redirected. Just wondering if anybody has any other ways to solve this problem. Would ProCache solve this? Thanks.
  15. Thanks for the quick replies. @Soma, enabling url segments is a great idea (wish I'd thought of it) and it did the trick. The way it ends up as far as URLs go, is like this: http://example.com/pw-managed-page/#/start-of-angular-routes. The code for my router configuration is like this: var MyAppRoutes = angular.module('MyApp', ['ngRoute']); function routeConfig($routeProvider) { $routeProvider. when('/start-of-angular-routes', { // note that it DOES NOT include the pw-mananged-page controller: AppController, templateUrl: '/ng-templates/app-template/' //don't link to file system html pages }). otherwise({ redirectTo: '/not-found' // angular managed page not found }); } MyAppRoutes.config(routeConfig); Thanks so much for your help. Much appreciated.
  16. Hi all, Starting up a web app and planning to use PW and AngularJS together for the first time. However, I'm having trouble getting Angular's routing to work. It seems that PW's rewrites are taking precedence so whenever I navigate to a URL that's defined in an Angular route, PW throws a 404 error. Has anyone successfully setup Angular's routing with ProcessWire? Would love to learn how it's done. Thanks!
  17. OK, makes sense. I've been looking into this after running my page through the Google PageSpeed and Yahoo YSlow tests, and I see now that this is really a different thing, it being server side as opposed to browser cache (as they are evaluating). Thanks guys.
  18. Hmm, I see. Thanks for the info. I was logging out before testing, but thanks for pointing that out. So, there's no way to validate that the caching is working, other than just observing the load time with and without caching on?
  19. Hi all, I'm trying to improve performance on one of the ProcessWire sites my agency manages, and having some problems with it. The template that the page below has a cache setting of 86400, with the default sub-settings (clear only the changed page, etc.) However, when I look at the Request headers I see that Cache-Control is set to max-age=0, and in the Response headers Cache-Control is set to no-store, no-cache, must-revalidate, post-check=0, pre-check=0, Expires is set to Thu, 19 Nov 1981 08:52:00 GMT and Pragma is set to no-cache. Am I missing something about how template caching works? Thanks. http://schools.saltmoney.org/content-pages/responsible-borrower-program-a-proactive-approach-to-student-debt-and-delinquency/
  20. Hmm, strange. Fixed now, thanks. Please do let me know if you discover with any issues with them on ST3.
  21. Hi all, I'm a big fan of the Sublime Text 2 text editor and of course of huge fan of ProcessWire, so I went ahead and created a library of PW snippets to be used with the ST2 Snippet system. I followed the PW cheat sheet, and created Advanced and Basic versions. The Advanced version contains only those seen in the advanced mode of the cheat sheet, so if you want the full set, you'll want to get both Basic and Advanced. They are on GitHub here: https://github.com/evanmcd/SublimeProcessWireSnippetsBasic https://github.com/evanmcd/SublimeProcessWireSnippetsAdvanced I've just submitted the Advanced set for inclusion into Package Manager, so hopefully that will be added soon. See the README for more info. Any feedback welcomed
  22. Thanks guys. @Soma, that was just what I was looking for. As long as I don't have to manage keeping the file in a different field based on it's type, it works for me.
  23. Hi all, I have a situation in which a user can upload a file that's any one of a number of formats (pdf, mpg, jpg, etc.). If the file is an image, I want to do some resizing. However, when I call ->size(###,###) on the file field when an image is in it, I get an error. Makes sense. I'm hoping there's an easy way to solve this without needing to create a separate field for image uploads. I tried following @Soma's advice from this thread, but kept getting an error from ImageSizer saying I was passing in invalid format. I know the file in there is an image as it's getting displayed in the browser. So, is there a standard way to convert a File field to an Image field? Thanks.
  24. Hi apeisa, I've messaged you with the code and database so you can (if you have time) set it up locally to test. I forgot to provide you with the admin login I created for you, though. It's: apeisa Vihti2013 The admin is located at /contest-admin/ Let me know if there's anything I can do to help. Thanks.
×
×
  • Create New...