Jump to content

Leaderboard

Popular Content

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

  1. 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.
    4 points
  2. 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.
    4 points
  3. Hi, I apologise if this is the wrong forum for this question but I wasn't sure where else to put it. I work for the web team at an Australian government agency. We're currently evaluating a replacement CMS and we're really keen to use ProcessWire (I've used it for a couple of personal sites myself). There is a huge push from above to remain consistent with the majority of the Australian government and use one of the big name CMSs. We have tested this big name CMS and it really isn't suited to our needs. Our site is large and has a deep hierarchy (plus we have a number of other smaller sites as well). If we are forced to use the big name CMS, we have concerns about it functioning correctly, being easy for editors, and its performance. The executive are asking for more justification, documentation and proof as to why we should use a different CMS. I'm hoping that perhaps some people might be able to provide us with some example sites - especially government, or universities/museums/libraries, or any other institution with a large site that utilises a fairly deep hierarchy. If it's Australian that's even better. We are working our way through the Showcase section of the forum and the Sites list, but so far haven't found anything that is a really large website that is also government or similar. Plus I thought there might be some sites out there that have not been submitted. So if you know of a site that fits the bill please let me know (or feel free to PM me if there's some reason you can't share it widely). I really appreciate this. We don't have the date of the next executive meeting yet, but we may have to present something quite soon and we need to be ready. Thanks, Margaret
    3 points
  4. Hi @Margie I'm an Aussie ProcessWire developer. Happy to help you promote the ProcessWire cause
    3 points
  5. I'd suggest the full package of Laragon. Comes with the usual AMP stack and a bunch of utilities that mike life easy. If you're happy with your existing stack, then maybe use Scoop, which is like Homebrew for Windows. Either way, git will become available in your path and your IDE can use it. I wrote a short post on Scoop some time back: https://blog.rockett.pw/post/scoop
    3 points
  6. 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.
    3 points
  7. 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
    2 points
  8. 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
    2 points
  9. Renewals and Resend Links Hi, Renewal and resend links pages for Visual Page Selector have been added. Use renewals if you wish to renew a Visual Page Selector order whose subscription has expired (1 year). Resend are for orders that are yet to expire. Use this if you can't find or didn't get the confirmation email sent after your purchase.
    2 points
  10. Glad it worked out for you. Laragon has replaced XAMPP and EasyPHP (in that order) as it's the only thing that works well for me. What's even better is one can add a "Quick Create" profile for ProcessWire, just by pointing to the latest ZIP release on GH. In the configuration option, add: # ProcessWire ProcessWire=https://github.com/processwire/processwire/archive/master.zip Done!
    2 points
  11. At the top of your template files, inside a <?php ?> tag, preferably before outputting anything. You can't send a new header after you've already sent them (i.e. output any data) For example: (in your home.php) <?php namespace ProcessWire; $session->redirect("/about/");
    2 points
  12. Even a bank is using ProcessWire Checkout the International Bank of Azerbaijan.
    2 points
  13. Also, with @adrian's Tracy Debugger module, you can try this to identify possible modules causing the issues: https://processwire.com/blog/posts/introducing-tracy-debugger/#module-disabler-panel Also there is a tool which might help tracing down problematic hooks: Event Interceptor Panel
    2 points
  14. Ah, sorry missed that!!! No hooks and no modules (other than core and ProFields repeater matrix) related to that template. Repeater Matrix is working on other templates OK and is only used once in the offending template. I've not come across Tracey debugger before. Do you mean this: https://modules.processwire.com/modules/tracy-debugger/ ? Thanks again.
    2 points
  15. Probably the best person to ask BTW, should you manage to assemble a good list, please do not forget to post it here.
    2 points
  16. Thanks @szabesz, I hadn't seen that thread but I'll share it with the others in the web team! Thanks to you and @DaveP for the links to the site categories as well. We have had a bit of a look through those and will continue to do so. I guess we were hoping we might unearth some additional ones. Yes, it's good in a way that PW doesn't advertise itself all over your source code, but at the same time it makes it hard to figure out just how many people are using it! I'd love to know what some of those major sites are. I wonder if Ryan would be able to tell me if I asked him...
    2 points
  17. Ryan has hinted in the past that he is aware of some major (global/multinational) sites that are built on PW but that don't advertise that fact. And of course PW doesn't have a front-end fingerprint like many other CMSs. Also take a look at https://processwire.com/about/sites/categories/education/.
    2 points
  18. The first loop assigns each item in $page->related_products to $matrix_item, so you have one $matrix_item after the first loop. When you delete the first empty loop you will have no $matrix_item anymore in your if statement. When you delete the second one then you will have only one $matrix_item, from your first empty loop.
    2 points
  19. This code seems to render a repeater matrix, are you using field render functionality? Like echo $page->render->matrix_field which uses /site/templates/fields/matrix_field.php? If so, you can divide your code into multiple files for each matrix type and put those under /site/templates/fields/matrix_field/type1.php and so on. https://processwire.com/blog/posts/more-repeaters-repeater-matrix-and-new-field-rendering/#processwire-3.0.5-introduces-field-rendering-with-template-files There's also wireRenderFile() to render a template file with given variables and return string output. I use it a lot in my templates. https://processwire.com/blog/posts/processwire-2.5.2/#new-wirerenderfile-and-wireincludefile-functions I tried to clean up your code. Some remarks: If you know there's only one page in a wirearray, you can get it with $arr->first Use if(! $some_condition) return; to reduce nesting You can open and close <?php ?> tags to give yourself some flexibility, so you wont have to put your HTML inside PHP strings. Anything you put between php tags will be echoed. <?php namespace ProcessWire; // dont show if user is not superuser if (!$user->hasRole('superuser')) return; // dont display partial markup if there are no related products if(!$page->related_products->count) return; // used for picking a random product from related products $randomSelector = 'template=product, sort=random, limit=1'; ?> <div class='uk-section uk-section-muted section-related'> <div class='uk-container'> <h3>Related Products</h3> <div class='uk-grid-match uk-child-width-1-4@s' uk-grid> <?php foreach ($page->related_products as $matrix_item): ?> <?php $randomProd = $matrix_item->related_random->children($randomSelector)->first; ?> <div class='rel-prod-ov-wrapper'> <a href='<?= $randomProd->url ?>'> <img src='<?= $randomProd->images->first()->url ?>' class='rel-prod-preview'> </a> <div class='rel-prod-ov-text'> <span class='rel-preview-title'><strong>Part No:</strong> <?= $randomProd->title ?></span><br/> <?= $randomProd->prod_summary ?> <a href='<?= $randomProd->url ?>' class='uk-icon-button rel-icon-linky' uk-icon='icon: chevron-right'> <!-- THERE SHOULD BE SOME TEXT HERE --> </a> </div> </div> <?php endforeach; ?> </div> </div> </div> Not sure if this works, there are some parts I couldnt make sense, but it should give you some ideas. If you give more info, I might be able to help you better
    2 points
  20. I do not update all sites to 3.x or 2.8.x. I have sites from 2.4, 2.5, 2.6, 2.7, and some different 3.0.x. Only one of version 2.8! (never touch a running system)
    1 point
  21. What about sites that still use PW 2.7?
    1 point
  22. I haven't tested at scale, but Ryan notes: https://processwire.com/blog/posts/pw-3.0.46-stocking-stuffers/#new-pages-api-manipulation-methods
    1 point
  23. Thanks for the quick solution, @adrian. I'm not sure if we're talking about the same thing, but docs mention that these methods modify other siblings to accept new order.
    1 point
  24. 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
  25. @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
  26. Thanks AndZyk . I will definitely give this a shot and see where this takes me. I completely forgot about GET (and I am still learning). Ill let you know how it goes. As for CSRF, that is a great idea. This is largely an internal site, but I will definitely take the precaution.
    1 point
  27. Just a quick heads up: Bower is sadly becoming obsolete. The developers of bower recommend: I have settled with Yarn for now, a better package manager for node modules by Facebook, Exponent, Google and Tilde.
    1 point
  28. Renewals and Resend Links Hi, Renewal and resend links pages for Dynamic Selects have been added. Use renewals if you wish to renew a Dynamic Selects order whose subscription has expired (1 year). Resend are for orders that are yet to expire. Use this if you can't find or didn't get the confirmation email sent after your purchase.
    1 point
  29. Renewals and Resend Links Hi, Renewal and resend links pages for Variations have been added. Use renewals if you wish to renew a Variations order whose subscription has expired (1 year). Resend are for orders that are yet to expire. Use this if you can't find or didn't get the confirmation email sent after your purchase.
    1 point
  30. Renewals and Resend Links Hi, Renewal and resend links pages for Media Manager have been added. Use renewals if you wish to renew a Media Manager order whose subscription has expired (1 year). Resend are for orders that are yet to expire. Use this if you can't find or didn't get the confirmation email sent after your purchase.
    1 point
  31. thanks for everything @abdus ! I merged the database of the crashed one with the backup db. After some trys it worked again : ) I still don't know how did that happen, added three fields to a template in the backend -> Reno crashed -> Default Admin Theme worked for 5 seconds -> then these errors. It was a PW 3.0.71 installation. Well, hope won't happen in future.
    1 point
  32. @Mike Rockett - thanks for your advice. Scoop looks really good! I actually installed Laragon today and it appears to give me what I need. The terminal is nice and it even gave me Vim from the command line. Pretty sweet Hey, @abdus - I tried installing again with no luck. I then added the missing profile and re-installed and all seemed OK until I entered Powershell. It just errored and then said something about the profile wasn't digitally signed. It said delete it or rename it. More crashing ensued and then, I gave up! It looks really good but, given the installation issues I've had, the juice isn't worth the squeeze.
    1 point
  33. yes, tracy is awesome and would recommend you having a look though sometimes it slows things down a little. i also experienced that the debug mode can slow down things. in your case i would do the following: backup install tracy and see if you find any strange things (errors, many redirects etc) create a new template, check performance if performance is ok, add fields of your slow template one by one and check after adding each field. if it slows down at some point you could investigate further
    1 point
  34. i would have been surprised if that had made a difference thats why i asked this:
    1 point
  35. Hi @Margie We have a somewhat similar thread running, have you seen it? The first two usecases in my post are good ones I think. Also there is a category: https://processwire.com/about/sites/categories/government/ Ryan's "own" site is a good example regarding complexity, features and speed but of course it is "off topic" otherwise.
    1 point
  36. Thanks guys.. @abdus I'm not familiar with a lot of your method but I'm looking forward to reading up on them and improving my PHP. I'm not familiar with return for example. In the short term I might break down my single PHP block into smaller more manageable blocks and rework it a little. I did try using your example to test it and I got a server error but aside from that am I correct in thinking that the actual Related Product heading isn't based on any conditional. @szabesz and @fbg13 thanks for the tips.
    1 point
  37. I would also like to point out what @abdus also did in his example: I try to avoid expressions like these: <?php foreach($page->related_products as $matrix_item) {} foreach ($matrix_item->related_random->children('template=product, sort=random, limit=1') as $prod) {} instead: <?php $related_products = $page->related_products; foreach(related_products as $matrix_item) {} $random_children = $matrix_item->related_random->children('template=product, sort=random, limit=1'); foreach ($random_children as $prod) {} Often easier to read but most importantly one can inject bd($random_children) /Tracy/ or error_log(print_r($random_children,true)); into the code to debug the result sets. BTW, I also use the "style" @abdus presented. PHP is A templating engine itself and that is how a native PHP template looks.
    1 point
  38. Hi Mike, Thanks, I think you're exactly right. Hopefully we can be the first to lead the way! (Though I still hope there might be someone out there already...) Even examples of large sites, regardless of their type could be helpful. I've told our web manager about Ryan's Villas of Distinction site as I read it had about 5000 URLs at launch. Or if any Australian users/developers/sites could make themselves known that may help too. I know there are 4 Aussie developers listed in the directory. Are there any more of you out there? In fact, any Australian government site, even if small, if one exists, would be good to add to our list. Fingers crossed!
    1 point
  39. Hi Margie, I really wish I knew of some big government sites powered by PW, though I can make an assumption as to why there many not be any, and it's exactly as you say it: big name systems tend to come first (I guess people are fearful of jumping into the unknown). I'd imagine that many of them use Drupal or maybe even SiteCore (I think it's that one, not sure). It would've been so much nicer if those above could delegate properly, and know full-well in advance that no matter what system is used, it would be used well because it would've been vetted properly (trust issues, perhaps?). That aside, hopefully there are some sites that folks know of and that it helps point the project in the right direction (nudge nudge).
    1 point
  40. $field = []; $childrenByField =[]; foreach($children as $child) { $tableCount = count($child->prod_vid_bandwidth); if($tableCount>0) { foreach($child->prod_vid_bandwidth as $item) { $value = number_format($item->band_lo,1,'.',''); $field[$value][] = $child; } } } foreach($field as $f => $items) { $childrenByField[] = "$f"; } if(!empty($childrenByField)) $prod_vid_bandwidth_lo = implode(" OR ", $childrenByField); $field = []; $childrenByField =[]; foreach($children as $child) { $tableCount = count($child->prod_vid_bandwidth); if($tableCount>0) { foreach($child->prod_vid_bandwidth as $item) { $field[$item->lo_unit][] = $child; } }} foreach($field as $f => $items) { $childrenByField[] = "$f"; } if(!empty($childrenByField)) $prod_vid_bandwidth_loU = implode(" OR ", $childrenByField); $field = []; $childrenByField =[]; foreach($children as $child) { $tableCount = count($child->prod_vid_bandwidth); if($tableCount>0) { foreach($child->prod_vid_bandwidth as $item) { $value = number_format($item->band_hi,1,'.',''); $field[$value][] = $child; } }} foreach($field as $f => $items) { $childrenByField[] = "$f"; } if(!empty($childrenByField)) $prod_vid_bandwidth_hi = implode(" OR ", $childrenByField); $field = []; $childrenByField =[]; foreach($children as $child) { $tableCount = count($child->prod_vid_bandwidth); if($tableCount>0) { foreach($child->prod_vid_bandwidth as $item) { $field[$item->hi_unit][] = $child; } }} foreach($field as $f => $items) { $childrenByField[] = "$f"; } if(!empty($childrenByField)) $prod_vid_bandwidth_hiU = implode(" OR ", $childrenByField); unset($tableCount); Here's the code that finally output my table fields. Note that my floats were being converted to integers so I had to force the display of their decimal places with number_format(). Originally, I hoped to cycle through the fields and output standardized strings of HTML based on their type and structure, but in the end I am omitting too many fields, and need to specialize the output code a little too much to make that feasible. So I am working my way through 170 fields, but hopefully this will put me ahead in this project when I'm done (toward integrating a Pages2PDF tie-in from these fields later), rather than being as behind as I feel! Thanks so much to everyone who chimed in to give me a hand!
    1 point
  41. You can configure procache to leave certain tags alone by either including them inside the "do not minify content within..." field or by placing <!-- NoMinify --> comments around it.
    1 point
  42. If you don't want to call a method, or want to use it in a string, you can use $page->header_OR_title too. echo "Text: $page->headline_OR_title"
    1 point
  43. I've looked at the lines given in the error report, they all point to $language ($user->language) but can't access it. If you can access your database (adminer, PHPStorm, phpMyAdmin etc) examine field_language table. Confirm that your current user (admin = id: 40) has a language associated with it. Also see if $pages->get(<languageid assc. with admin>) returns anything
    1 point
  44. Now in the modules directory. Want to update the module soon with some new flavors ... http://modules.processwire.com/modules/markup-processwire-photoswipe/ Cheers!
    1 point
  45. The way i see Gantry is like a really developed 'frontend api', which seems to use an mvc-ish model; I use a frontend api based on the wireRender pattern which is in some way similar to the Gantry setup. In PW, it could be done, you'd end up with several interconnected modules that simplify frontend needs, like global settings, managing per-page assets, injecting stuff (js, schema, meta etc) into the head.. There are already some frontend api modules now like Spex; For just having a styles guide page, that would be easy, you could just have a pure html page showing all of the demo stylings, sections, shortcodes and whatever; or have a hardcoded demo site on a subdomain for the clients to reference.
    1 point
  46. If I understood correctly what is the need, here is another simple idea I used in the past to have a text field where you can add hundreds of url's one per line. After that, wherever you need to pull every url, you just grab the line and you are done: <?php foreach(explode("\n", $page->your_urls_text_field) as $url) { // Explode every new line as a new url echo "<p>$url<br />"; //You can add <a href.. etc. } ?> The only requirement is to have every new url on a new line to make it work. Hope that helps...
    1 point
  47. Now everything works fine Here is a small video to demonstrate the ajax login process for others who are also interested in creating an similar login process. Finally I have decided to redirect to the same page instead to the profile page because I think it is much more comfortable for the user. The form will be loaded via ajax. All inputs (username, password) will be checked in real time against the database. If everything is correct, the user is able to click the button and the login process starts. After finishing the login process I use a get parameter in the url to show a success message. Best regards
    1 point
  48. Much of this defers to the GNU v2 license. My thoughts are that people should feel free to make their own admin theme and put their logo (or their clients logo) wherever they see fit. But regardless of admin theme, I do think the software name ProcessWire, version number and copyright should always remain in the footer of the admin at least. The reason for this is that I don't ever want ProcessWire to be a burden on a client. Web sites very often outlive the relationship of the site developer to the client. I think it's important for the client to know what software and version they are using and where it came from. Without that, if some future issue surfaces, the client would be blind and ProcessWire would be a burden on them. Can you imagine white label installations of any other major open source CMS out in wild, and what a security nightmare that would be? Keeping this information in a place where the client can find it keeps everyone honest about how the software is licensed. If someone just provided a re-branded PW to a client and charged them $25k for it, I think it's important that the client knows they are paying for a service from their developer and not the software. If a company still felt strongly that they needed to remove the software name, version and copyright from the admin, then I'd want them to keep and maintain a long term support contract with us and make the GNU license really clear to the users of the software.
    1 point
×
×
  • Create New...