Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/24/2017 in all areas

  1. This could be part of AOS, perhaps with an option what templates to include.
    4 points
  2. You could try putting TracyDebugger as it always gives me more errors than the standard debug mode. From my humble experience, there got to be something with the access to the templates. Maybe you could try setting one off the template files to 777 and see if that helps. The hosting - is it a server you control or is a shared one? If you have control over the folder, you might want to checck if your webserver (apache, nginx etc.) has its group assigned to read/write. Hope that helps...
    3 points
  3. Sorry about that - should be fixed in the latest version.
    3 points
  4. Just pushed a new version which has the following improvements: Console panel calls now process /site/ready.php and /site/finished.php (along with /site/init.php which already worked) - thanks to @bernhard for help testing this. Captain Hook panel now sorts hooks alphabetically within each file/class, rather than the old order by line number in the file - this makes it much easier to browse. Updates to Ace editor (used in the console panel) and the Tracy core. Some other tweaks. Cheers!
    3 points
  5. 3 points
  6. I just test it and it works great. I replaced "saved" with "published" otherwise everytime my client will edit the pages sorting will applied. So for PW 3.0.46+ no need this module.
    3 points
  7. It needs to be set on every template file. Although there's template compiler that does it for you, I am not satisfied with how it performs. Here's the relevant blog post: https://processwire.com/blog/posts/processwire-3.0.14-updates-file-compiler-fields-and-more/#file-compiler-updates
    3 points
  8. A few government / university sites for you: This one is currently mostly US government (https://ecoreportcard.org/), but there is one report card for by the Brazilian government (https://ecoreportcard.org/report-cards/guanabara-bay/about/) and another for the World Wildlife Fund (WWF) and the Columbian government (https://ecoreportcard.org/report-cards/orinoco-river/about/). And there will be more international ones to come in the future. This site has quite a deep hierarchy. This one is a Maryland State Government and University of Maryland initiative: https://chesapeakebaystory.umces.edu/ This is a US and Australian government combined education initiative: https://usaus-h2o.org/ (it's looking pretty old now - it was actively used for a 3 years, but is abandoned, for now at least). Another one for Maryland government and other universities and agencies: https://madeclear.org Hopefully there are some useful examples for you there.
    3 points
  9. Just so that others than Margie can also see this information. I/we could all find more of them. WIth inurl: (and more), for example. I've removed 3 websites that had between 2500 and 3000 results. inurl:http://arts.ufl.edu/ -> about 5 400 results inurl:http://www.kidsportcanada.ca/ -> around 5 610 results inurl:http://visionsource.com/ -> around 5 670 results inurl:https://www.clinicalgenome.org/ -> around 13 900 results
    3 points
  10. I tried, but couldn't reproduce the problem on my end using Google Chrome. You might want to specify in the issue what web browser you are using? I'm using the latest PW 3.0.72. You might also try with a reduced test case without multilingual, Google Maps, etc... to help narrow down your issue.
    2 points
  11. Ah - the old windows vs linux case issues I guess
    2 points
  12. @franciccio-ITALIANO I do not thing that somebody other than you could say what is the best practice in such a simple matter so just pick the one you feel is making more sense and try it out. Again, it all depends on your preferences and the idea behind it. We just provided a few ways to accomplish it but the rest is up to you. Try one and see how it works. If not, try the next, the next and so forth until you are good with what you have (at least this is what I do)
    2 points
  13. Hey @adrian, thanks for the update. At the moment Tracy doesnt check whether ready.php and finished.php exists or not, and gives this error.
    2 points
  14. Speaking of horst: https://modules.processwire.com/modules/pageimage-remove-variations/
    2 points
  15. You'd have to delete the variations. http://cheatsheet.processwire.com/files/image-methods/image-removevariations/ https://processwire.com/api/ref/pageimage/get-variations/ https://processwire.com/api/ref/pageimage/remove-variations/ @horst will probably give you more advice....
    2 points
  16. Facebook doesn't let you pull images if you aren't logged in. Meaning, only the client side can pull images, the server side cannot (meaning, ProcessWire cannot since Facebook blocks it). So if you are going to use picture or picture_url (or other images), you have to refer to it directly in an <img> tag using the URL facebook provides, rather than trying to pull a copy and store it in PW.
    2 points
  17. @PWaddict change $templates as necessary $this->addHookAfter("Pages::saved", function($event) { $templates = ['product', 'post' ]; $page = $event->arguments[0]; if (! in_array($page->template->name, $templates)) return; $this->pages->sort($page, 0); });
    2 points
  18. Just trying to save you the head scratching I had to go through to get even that kind of rudimentary understanding!
    2 points
  19. My site runs fine. Just cannot edit or create pages. Finally, I rebooted server. That brought back pages tree for new sessions. Hooray. Back in the saddle.
    2 points
  20. Hi @abdus, I wasn't aware there was built in caching capabilities outside of Procache. I've checked it now and alas it is off. I'm also a Procache subscriber but have turned that functionality off too. But your comment about template caching somehow inspired me to try connecting to the index.php directly, and that seems to fixed the problem (?!?!) Now Safari and all mobile browsers are loading normally, per normal without having to reference the index.php directly. I have no idea why that has fixed it. I've checked the DirectoryIndex section of .htaccess file, and it's exactly the same as the the default Processwire file. Thanks a lot for your cache busting script. Will incorporate it probably at the next release as a backup plan for such scenarios.
    2 points
  21. @louisstephens you don't really need ajax, you can use History API to change address bar and browser history without refreshing https://stackoverflow.com/a/19279428
    2 points
  22. Thank you for mentioning. I have mentioned earlier in this thread, that Guetzli is in the newest alpha of ImageOptim included, but forgot to spread the news that it is now in the stable version as well. I am using Guetzli with ImageOptim for a while now and yes it is really slow and if you dare to optimize a lot of high quality images, be ready to get your fan heated up. But on the other hand I usually have a optimization rate of about 60%. Compared to the about 20% when Guetzli is disabled, I think it is absolutely worth it.
    2 points
  23. Do you have template cache enabled? When you're logged in on your PC, you wont notice anything, because cache will be disabled but visiting the page as guest on an iOS device you might be getting a cached version with the old content and old URLs. Although I see you've tried using query strings, I often use this function to create cache busting URLs for CSS & JS. If the file is modified, correct modified time string is appended to the URL and browser downloads newer version. No need to increment version manually. /** * Adds file modified date as query string and returns URL to given asset. * * * @param $relPath string File path relative to /site/templates/, such as "assets/css/style.css" * @return string URL with cache busting query parameter */ function assetUrl($relPath) { $fullPath = wire()->config->paths->templates . $relPath; $modified = filemtime($fullPath); $url = wire()->config->urls->templates . $relPath . "?v=$modified"; return $url; } In your templates, you can load a script like so: <script src="<?= assetUrl("assets/js/main.js") ?>"></script>
    2 points
  24. It's been a while and i share my first results: 1) Make some pages with FieldtypeMapMarker 2) Build a form with an input for the Zipcode/PLZ and a select for the radius. 3) upload the .tab file in your template (german zipcodes) tomorrow i will make the styling and getting the distance between plz and results and render the google maps. code: define("OGDB_LOCAL_DATA_FILE","./PLZ.tab"); function plztolatlong($plz) { $fileData = @file_get_contents(OGDB_LOCAL_DATA_FILE); if ( $fileData == FALSE ) { die("ABBRUCH: konnte Daten nicht laden (".OGDB_LOCAL_DATA_FILE.")\n"); } $fileData = explode("\n",$fileData); for ( $i=1; $i < count($fileData); $i++ ) { $fileRow = explode("\t",$fileData[$i]); if ( $plz == $fileRow[1] ) { $origin_lon = $fileRow[2]; $origin_lat = $fileRow[3]; $city = $fileRow[4]; } }; $out['lat'] = $origin_lat; $out['lon'] = $origin_lon; $out['city'] = $city; return $out; } $distance = $input->post->radius; // Get distance $plz = $input->post->plz; // Get PLZ $getlatlng = plztolatlong($plz); // plz to lat and long $lat = $getlatlng['lat']; // just for test reasons later $lng = $getlatlng['lon']; // just for test reasons later echo "<pre>"; print_r($getlatlng); echo "</pre>"; echo "LAT: " . $lat . "<br />"; echo "LONG: " . $lng . "<br />"; $radius = 6371; // earth's radius in km = ~6371 // latitude boundaries $maxlat = $lat + rad2deg($distance / $radius); $maxlat = str_replace(',', '.', $maxlat); $minlat = $lat - rad2deg($distance / $radius); $minlat = str_replace(',', '.', $minlat); // longitude boundaries (longitude gets smaller when latitude increases) $maxlng = $lng + rad2deg($distance / $radius / cos(deg2rad($lat))); $maxlng = str_replace(',', '.', $maxlng); $minlng = $lng - rad2deg($distance / $radius / cos(deg2rad($lat))); $minlng = str_replace(',', '.', $minlng); $q = "template=filialen, mapfield.lat>=$minlat, mapfield.lat<=$maxlat, mapfield.lng>=$minlng, mapfield.lng<=$maxlng"; $results = $pages->find($q); echo "<h2>Ergebnisse</h2>"; foreach($results as $r) { echo "<h3>{$r->title}</h3>"; echo "<p>{$r->mapfield->adress}</p>"; echo "<p>{$r->filial_tel}</p>"; echo "<p>{$r->filial_mail}</p>"; echo "<p>{$r->filial_www}</p>"; } echo $ff; FILES: PLZ.tab
    1 point
  25. I've updated the pens, now it is possible to add padding and show text too (left or right side).
    1 point
  26. found the error. was a stupid mistake i made. the local server didn't differentiate between the templates name »Person« and »person« but the live server did :/. thanks for you help!
    1 point
  27. Ryan keeps old versions available from the download page. You should have no problem running those older versions on PW 2.7, but you will miss out on some features, like pagination in the Table field.
    1 point
  28. Update: Menu Builder Version 0.2.0. Changelog Modified 'current_class_level' option to apply 'current_class' to a menu item when viewing any of its descendant child pages (child, grandchild, etc.) in cases where those descendant pages are neither part of the menu nor included via 'include_children'. To enable this, set 'current_class_level' to '0'. Thanks @Mike Rockett for reviving this. Note I have tested this thoroughly but sometimes in Multilingual sites, depending on some conditions I am yet to pin down, the setting does not work properly. In such cases, using 'current_class_level' >= what you need does the trick. Please test and let me know. In dev branch for now.
    1 point
  29. Maybe the files in the site/templates folder are not readable - do you have debug mode turned on?
    1 point
  30. You're right. I replaced "published" with "added" and it's even better cause now the unpublished ones are getting sorted properly too. Thank you. What AOS means?
    1 point
  31. Sounds like a great idea. I would still perhaps suggest Pages::added, rather than Pages::published though - what does everyone else think?
    1 point
  32. @rick What has been logged to /site/assets/logs/errors.txt (also exceptions.txt)? It can help you pinpoint the origin of the error. EDIT: Hmm. I think after authorization with FB, it redirects back to your public endpoint with a token code, but it seems like something about that page or FB module causes error to be thrown
    1 point
  33. All three slides have the same image, unless that's the intended behaviour, or all images are the same, which I doubt, make sure you're using the current iteration element ($img) inside your loop. <div class="flexslider"> <ul class="slides"> <?php foreach ($page->slideImages as $img): ?> <li> <img src="<?= $img->width(1200)->url ?>" /> </li> <?php endforeach; ?> </ul> </div> Another thing is that you're loading 2 different jQuery scripts on the page. The one packaged with Foundation (under bower_components) is sufficient. <script src="bower_components/jquery/dist/jquery.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.min.js">\x3C/script>')</script> In fact, why not use the slider that comes with Foundation instead? You're already loading foundation js files. http://foundation.zurb.com/sites/docs/orbit.html
    1 point
  34. @abdus is absolutely right. Just to expand a little, what is happening when you do that is saying to PHP 'in this file the variable "item" to be treated as "ProcessWire\item" (for example)'. That means that if you were to find some code on e.g. GitHub that you wanted to include(), so long as it is namespaced, it can use an "item" variable (which will be treated as e.g. "ClassName\item") and can't conflict with your "item" variable. I'm currently developing a personal site that uses an image processing library I found on GitHub and it was fairly straightforward (even to a thickhead like me), to sort out the namespacing stuff, thus ensuring no naming conflicts. FWIW I thought namespacing was an unnecessary faff when Ryan first started on PW 3.n, but having seen the benefits, and considering the only downside is one extra line of PHP at the top of every file, it's not really worth leaving it out.
    1 point
  35. Based on the suggestion by @abdus, put this in your ready.php file: $this->addHookAfter("Pages::saved", function($event) { $this->pages->sort($event->arguments[0], 0); }); Note that $event->arguments[0] returns the page that was just saved. Perhaps it would be a good idea to resort all other children too - have a read more about this here: https://processwire.com/api/ref/pages/sort/ I think in this use case you'd actually want to use the parent of the saved page so that all child pages are sorted. I honestly have played around with this, so not sure if it matters or not.
    1 point
  36. That worked great @AndZyk! I appreciate the help. Now for a dumb question, once redirected, success="true" (in laments terms), notification displays, is there a way to remove the ?alert=success from the url ? As it stands, I have a script that refreshes the page every so often to get any new changes that might have been made on the site, and currently the alert will just keep posting. There probably a better way to handle the refresh as well like ajax, but I dont quite know how to tackle that. I guess this was just an impromtu way of doing things.
    1 point
  37. @PWaddict after v3.0.46, there're $pages->sort() and similar methods to move pages and change their order I haven't tried this, but from what I understand from the docs, $pages->sort($pageToTop, 0); moves a page to top of its siblings. https://processwire.com/blog/posts/pw-3.0.46-stocking-stuffers/
    1 point
  38. Probably a better link in this case: *** ignore this *** EDIT: ah, I FOUND it under the "jumbotron" Anyway, thanx for the info!
    1 point
  39. Hello @louisstephens, you could use a GET parameter inside your redirect. For example: <?php $session->redirect($dash . "?alert=success"); // On your dashboard template file if ($input->get->alert === "success") { // Show your notification } If you plan to build a login be sure to use CSRF and maybe honeypot validation: Regards, Andreas
    1 point
  40. I had the same discussions when i joined a new agency and when we started to make a relaunch of one of our sites. They all wanted Typo3 or WP, but fortunately i could convince them to use ProcessWire and i was happy as f*ck. You save at least 50% of time when building functions with the awesome PW API comparing to other CMS. You can use PW for small and large sites, where other CMS would be a total overkill. I experienced that so called big CMS with ~100 Sites have a loading time of > 4 seconds (even with caching, gzip, css + js compression, .. ). From one to endless languages or PW Sites with > 100.000 subsites shared in the forum, theres no limit in my opinion. After 2 years of developing with PW, it was the best decision of my life switching from Typo3 and WP. Just warn your Co-Workers working with PW is addictive and they'll never come back
    1 point
  41. I have tested your JS it is working fine for me. The fact that your input makes an Ajax request (even if it is empty) is also a good sign. With the debug option set to true I also don't get any informations inside the console, probably because it is working. You could try to make an regular Ajax request and echo a static response first to test. Also you could try to exactly copy & paste my example from the tutorial mentioned above. Lastly I hope you didn't have exactly copied & pasted my Ajax example, because the selector in there is just an example and doesn't really work. If you don't get any further, you can PM me more of your code or an link, in case your site is online.
    1 point
  42. I've faced the same issue, and landed up changing the domain extension to .local instead of .dev due to the ICANN name collision. It's been working like a dream so far. Note that, if you do this, you will need to manually edit your hosts file, as well as your Apache vhosts (shortcuts to all of these are available in the system tray menu) for existing sites.
    1 point
  43. Margie recommends you to see also a comparison of CMS CRITIC Which is built on the framework of ProcessWire ... Mike Johnson wrote an interesting article citing PW to WP ... On the other hand, this page I like SPAIN CULTURE, but I do not know that government ...
    1 point
  44. Hey Margie. Hope you can convince them to use PW. Sorry for the long contribution, but I hope I'm giving you a good argument. I've had a similar discussion a while back when I was "selling" PW to one of the main shopping centre chains here in Portugal (dolcevitatejo.pt is one of these sites, made in PW). They wanted an OS CMS and were leaning towards Wordpress, and I managed to convince them. My main argument was security. Check out this article: https://www.notanotherdotcom.com/blog/a-better-cms-part-1-security/ PW is inherently closed, with no plugins that conflict with one another or reveal publicly known vulnerabilities that can be exploited. The big three are regularly targeted just because they're popular. Also, check out this security log for PW (you'll have to register first): https://secuniaresearch.flexerasoftware.com/community/advisories/search/?search=processwire ... then search Wordpress, Drupal, Joomla, whatever you want. Processwire : 0 (zero) incidents, EVER! Wordpress : 17 incidents in 2017 Drupal : 4 incidents in 2017 Joomla : 4 incidents in 2017 These include: Cross-Site Scripting Vulnerabilities SQL Injection Vulnerabilities Security Bypass Vulnerabilities Local File Inclusion Vulnerabilities All of which are as scary as nature is in Australia. I've never heard of a PW site being compromised since I discovered it 3 years ago. One curiosity I like to point out is something Ryan said somewhere about password recovery on PW's login page. You don't have that installed by default and need to turn it on yourself, because with password recovery on, the CMS's security will only be as high as that of the admin's email.
    1 point
  45. Hi. Search the forums for 'university' as well. I know of some people here who work or have done work for Universities. I don't want to mention their names without their consent, although they've previously publicly posted about their work. Edit There's also this in the showcase forums
    1 point
  46. Even a bank is using ProcessWire Checkout the International Bank of Azerbaijan.
    1 point
  47. Hi @tpr, I will look into this and add a solution that will work properly together with markup-srcset, (and other cases). Thanks for the clarification.
    1 point
  48. I think it's a different thing what @dreerr is talking about. Consider this scenario: Set a crop setting on an Image field, eg. "work-thumb, 320, 270" Use it with a srcset solution (either with a module or manually) and that will make you a 320x270 image and some variations - let's assume only one, 160x135: image.-work-thumb.jpg image.-work-thumb.160x135.jpg Now edit the image again and crop a different part. The results: image.-work-thumb.jpg <- changes according to the new crop image.-work-thumb.160x135.jpg <- no change! I'm also interested in a solution because CI3 can't be used for srcset purposes atm if I get it right. What I could imagine as a simple fix is that when CI3 saves a new crop it would delete any size variation of it (in this example all images that are named "image.-work-thumb.WIDTHxHEIGHT.jpg"). Then the srcset generators could re-create these size variations again. Perhaps this behavior could be optionally set in the module's settings.
    1 point
  49. Hi, I do not think there are solid statistics to showcase but we have good blog posts you might use to pick the info you can use to persuade clients: https://processwire.com/blog/posts/building-canongate/ https://processwire.com/blog/posts/cms-critic-powered-by-processwire-again-case-study/ https://processwire.com/blog/posts/new-2.8-version-current-projects-and-pw-usage/ https://processwire.com/blog/posts/roadmap-2017/ etc... Also, you can find good case studies here: https://processwire.com/talk/forum/9-showcase/ https://processwire.com/talk/forum/16-case-studies/ https://weekly.pw/ (site of the week) Hope this helps.
    1 point
  50. $input->whitelist does not store values. It does just mark $input variables of the current request, so they can be appended to (pagination) links as ?my_data=xyz variables, which on the next request can be read again. If non of those links is clicked the values are gone. The most prominent use case is preserving any user filter values while going through pages of results. Having the values in the url also makes sure you can send that url to your peer and he or she can open it as well. Anything you don't want the user to see/modify you'd use the session.
    1 point
×
×
  • Create New...