Leaderboard


Popular Content

Showing content with the highest reputation since 06/12/2018 in all areas

  1. 6 points
    I was wondering how to override the style on a PW form only to find I posted the solution above 2 years ago
  2. 5 points
    Hello If you like, you can now download a demo of this "setup" or "snapshot". I think it's "ready enough" to try it and to see what you think. Donwload this installer file (Duplicator), put it in a web root and rename it to "installer.php" http://pwdev.square7.ch/download/installer.php.txt Put this zip in the same web root http://pwdev.square7.ch/download/2018-06-13_16-03-08-localhost.package.zip Call <yourweb>/installer.php and follow the instructions. An empty MySQL Database is required. If everything went smooth, you can log in as "admin" under /processwire using password: agu3j$Fh832a Then edit "home". You can add, delete, move, resize, dialog-edit and inline-edit the items (colums). At the bottom of the page, you will find "Grid Settings". There you can define which breakpoint will be changed when using wysiwyg resizing. This may be confusing if you change a breakpoint which does not correspond to your current screen width, because nothing happens visibly. You can hover over each element to quickly see the column settings. Some basic understanding of the Boostrap 4 Grid System is recommended (Link provided in the dialog). If you would like to change the german text in the demo, just select "Deutsch" where you see "Default" in the backend nav (AOS Feature). This demo is not about "stunning" design, it is kept as simple as possible showing the options which are there. If you would like to change the design, there is package.json in the root folder which should install everything you need. "npm install" is your friend. In "/site/templates/scss/shared.scss" is the sass-code shared by front- and backend. There would a be lot more to say, but I think this is enough for the moment. It's a demo, don't use it for your customers atm. Have fun!
  3. 5 points
    I'm in the middle of uploading them. They'll be perfected by the end of the day.
  4. 4 points
    I've updated the first post with info on how to run tests from the browser, so there's no need to have command line access to the server.
  5. 4 points
    IMHO building your prototype with PW gives you a solid base from which you can go in every direction. You can build just a part in Vue and let the Vue app grow over time. There's a little bit of effort involved to tie PW's pages, fields and templates and Vue templates together smoothly without a lot of overhead, but an experienced Vue dev should be able to wire that up quickly and in a reusable way (Vue would be my choice there as well). Exposing PW pages and limited write actions through ajax isn't hard to do either. It's also a walk in the park to migrate PW content into less normalized "external" tables with a small bootstrap script if performance really requires it, so unlike other CMSes where you have all kinds of different things (posts, pages, parts, whatever) in different structures, you don't really lock yourself in with PW. I agree with @LostKobrakai insofar as that there are in fact a few areas where a custom tool will get you further, like if you need a full-blown discussion forum. The choices there are rather limited if you want a good integration. Invision (the software this forum runs on) seems to be rather straight forward in that regard. I have tried my hand on a phpBB3 integration module and while the basics mostly work, it's really a PITA in some parts (like outdated examples and misleading documentation) and I've run out of time to get it into a really usable shape. There are probably a few Laravel forum components I've never heard of that can get you most of the way as a half way option. I think that will be the hardest part to decide, where will PW (or any other CMS or own development, in fact) ever only be the second best choice compared to a single purpose tool you can integrate.
  6. 3 points
    Just an FYI - the reason the template_id is set to the name of the template in the export is so it is translatable to another PW site where that template will likely have a different ID. This way the import process can use the supplied name to find and then set the local ID for that template.
  7. 3 points
    That works if you choose the %= selector (SQL Like) https://processwire.com/api/selectors/#operators
  8. 3 points
    I created a Discord Server for anyone to step by and say Hello https://discord.gg/3jCQgt5
  9. 2 points
  10. 2 points
    This issue was happening to me all of a sudden. Happened just after uploading a 3MB photo via the admin. Tried messing with permissions and no help. Tried deleting the photo via FTP and suddenly was able to login again. Uploaded another photo and got the "appears to be forged" warning. Then it occurred to me that possibly I had maxed out my allocated storage. This was the case. I increased my space on my hosting account and everything is good again.
  11. 2 points
    Very nice solution – i had the same issue with user profile pictures … this could work… On one of my pages I have a similar setup, I provide protected files using the page and the filename and then manually serving it using the render hook… Would need to look into the code… Something like > pathtothepage/?f=filename.jpg – because you know the page, you can access the file with PageFilesManager ($page->filesManager) and then send it using http://processwire.com/api/ref/wire-http/send-file/
  12. 2 points
    That's likely not going to be trivial. Adding check_access=0 in a selector to display the link is quite another thing as serving the secure file to a guest user. When you have pageFileSecure enabled, the following happens: PW prefixes the file directory site/assets/files/[PAGEID] with $config->pagefileSecurePathPrefix ("-" by default so it will be site/assets/files/-[PAGEID]) When the browsers tries to show the image (i.e. open the URL /path/to/pw/site/assets/files/1258/image.jpg in a separate request), the file isn't found by .htaccess .htaccess hands off the request to index.php index.php calls PageRender::execute with the request URL PageRender::execute checks if the request is to a file, then checks if the page it belongs to is published and viewable by the current user Since $user->hasPermission('page-view', $page) returns false (the guest user doesn't have view permissions) that fails (otherwise, PW would prefix the path now and output the file) PW outputs the 404 page Since the method where the check is are done is not hookable (and some necessary properties and methods are protected, i.e. not reachable from a hook) you'd probably have to hook before ProcessPageView::execute and duplicate a lot of code from ProcessPageView or hook after User::hasPagePermission and at least duplicate ProcessPageView::checkRequestFile in both cases, match the file URL to $page->image to prevent handing out a access to other file/image fields on the page Another approach (if the images aren't too big and the protected pages aren't too many) would be to include the real image data as data URIs: <?php foreach($protected_pages as $protected_page) { echo $protected_page->title . "<br>"; $fn = $protected_page->image->filename; $imgdata = "data:" . mime_content_type($fn) . ";base64," . base64_encode(file_get_contents($fn)); echo "<img src='$imgdata' alt='{$protected_page->image->description}' />"; } If the images are small enough but you have many pages, using PW's pagination might be an option too.
  13. 2 points
    @Robin S I finally found out what was breaking your (awesome) module - it was another module, of course, and one of yours too Specifically, it was Batcher (https://github.com/Toutouwai/ProcessBatcher) I'm converting a WP website and was using https://github.com/adrianbj/ProcessMigrator and https://github.com/nicoknoll/MigratorWordpress to import the pages from WP. The client insisted to maintain the URL structure of website.com/blog-post-here/ - hence the need for Virtual Parents to keep the page tree tidy. That's where I used Batcher to move the pages from their imported parent to the root of the website. After doing that, Virtual Parents broke. I restored a backup and tried again - this time moving the pages manually and Virtual Parents kept working fine! What I suspect the problem is: When trying to move the imported blog-posts manually, I noticed they were set up to have only one allowed parent - the blog-posts page (also created during the import). So basically, using Batcher, I was able to change the parent of pages to one that was not allowed through their template config. Not 100% that is was what was breaking Virtual Parents, but one definitely shouldn't be able to move pages with Batchers where they're not allowed to live. Thanks for all your great work!
  14. 2 points
    Thanks, fixed in v197. There are other places where there's no need to add but thankfully we have $page->trashable().
  15. 2 points
    You need to target a specific page, in this case the Home: $pages->get(1)->httpUrl This will get the page on the language the user is browsing the site, which is what you need I guess.
  16. 2 points
    Here's a try: <?php echo (selectorsMatch("baths>1, template=listing", "template=listing, baths>1")) ? "Match" : "No match"; function selectorsMatch($sel1, $sel2) { $s1 = new Selectors($sel1); $s1->sort('field'); $s2 = new Selectors($sel2); $s2->sort('field'); return "$s1" == "$s2"; } Not sure how this behaves with OR-groups, but it should be fine for simple AND selectors.
  17. 2 points
    That will do the trick, Thanks @Jonathan Lahijani I knew I could just use curl but if there is anything I've learnt it's ProcessWire always has an easier solution
  18. 2 points
    have you tried logging the POST request to both the URL and the URL with the Segment - it should be the same unless somehow URL segments are not activated on that template. The idea should work, I can't think of any reason why segments would not work on an ajax service page; if you keep hitting up against issues you could go for query parameters instead. You may also need to check if there is a URL segment present, like if(strlen($input-urlSegment etc.. ; and make sure to also do the regular sanitization of the $input, as well as return 404 for unused segments...
  19. 2 points
    WireHttp might be one solution. https://processwire.com/api/ref/wire-http/
  20. 2 points
    Find queries are cached for the lifetime of a request. Caching them more permanently needs additional code. I think there was an example for using MarkupCache to store JSONified query results in the forum a while ago, but I might remember wrongly. With highly dynamic sites, everything you know about caching best practices is at first no longer valid. Until you start factoring out the dynamic parts, that is. Decouple searches from the database by using a dedicated in-memory search engine (Lucene, OpenSearchServer etc.) to avoid high loads and table level locks. Cache IDs and values retrieved from frequent searches in memory (like newest n posts/comments), and when you scale up, delegate the job of updating those to cronjobs to eliminate any delays caused by rebuilding expired memory caches. Retrieve dynamic parts of the page through JS in JSON format and render them with a frontend framework so the static parts and templates can be served from the filesystem (that's where ProCache ties in). Design your pages to use placeholders for dynamic content so your users don't have to wait for client side rendering of dynamic content before they can start using the page.
  21. 2 points
    Check out @Jonathan Lahijani's new series of PW vs WP videos: https://www.youtube.com/channel/UCAzZwO7DZ91tQmZqZwe5vuQ
  22. 2 points
    "waiting for table level lock" would suggest that something is odd on the server side and/or mySQL. Maybe mySQL doesn't have enough memory, or is being re-booted every now and then, and can't handle the queries fast enough. Perhaps switching from myISAM to InnoDB would help already. Or maybe this is being caused by a large mysqldump process https://superuser.com/questions/1093610/mysql-5-7-stuck-forever-waiting-for-table-level-lock
  23. 1 point
    PW is MIT & MIT2: https://processwire.com/about/license/mit/ https://processwire.com/about/license/mpl/ In short: https://choosealicense.com/licenses/mit/ Distribution is granted but include license and copyright notice. You might want to state that your own work is MIT too. And of course, check what each module or any other library says about licensing. Generally speaking I think you will be ok to share it like that.
  24. 1 point
    Delayed output is not about concatenation but storing rendered html in a variable to be output later on. Eg: <?php $output = wireRenderFile("./partials/partial.php", array('page' => $page)); //lost of other code :) echo $output; Ryan prefers concatenation to wireRenderFile. I prefer wireRenderFile to concatenation, for example.
  25. 1 point
    SOLUTION below Yep. It works. Corrected code: $selector = "template=invoice"; $results = $pages->find($selector)->not("children.template=payment"); // or: $results = $pages->find("template=invoice")->not("children.template=payment"); // Doesn't work correctly (doesn't exclude pages with children.template=payment (PW 3.0.62 & 3.0.96)): $results = $pages->findMany("template=invoice")->not("children.template=payment"); It also executes 0,5-2 times faster than first working script. I've tried to use findMany method, but it doesn't work with not method.