Jump to content

jrtderonde

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by jrtderonde

  1. Sorry for my late response but thanks for all your messages. I'll look into the possibilities to develop this myself. If there's anything new from my side, I will keep you guys posted.
  2. Hey, I recently started working at a new agency where I'll be developing mostly back-end projects. One of my colleagues has introduced me to GraphQL. We're currently using Wordpress in combination with ACF but as I was google-ing I stumbled upon a post in which I saw a GraphQL module for PW, awesome! I think the agency wants to start moving towards a workflow in which we will use a CMS "headless". We build up pages using flexible content (or "Repeater Matrix") and I was wondering if anyone has any experience in using the pro matrix in combination with either graphql or rest api. Ultimately we would be looking to implement GraphQL as it's so fast and dynamic. Looking forward to hearing from your experiences ?
  3. Thanks! I'll try it in a bit
  4. Ok, but that's why I'm trying to prevent with the hash as $page->name. I'm using the ID of the customer combined with a timestamp to generate a md5 hash that's "unique". (See the code, I'm pretty sure it should work). Also, the next entry in the array has a complete different customer id. So it should be "impossible" to be duplicated. I'm using this code within a pageSaveHook (module). Could this be a problem? Furthermore, the array counts 11000+ entries, could it be that this is a problem? The platform is hosted on a stable and fast VPS and I cranked up the PHP execution time to 10 minutes, so it shouldn't cause any serious trouble.
  5. Hey, I'm working around a module that adds pages in my ProcessWire installation. The pages are added based on a JSON array that will be imported through a page save. Everything works fine except for when the pages are added. I get the following error Integrity constraint violation: 1062 Duplicate entry '3e215ecd6774fd99c2b0eb5cadf36a07-1269' for key 'name_parent_id' I'm using the following code/loop to generate the pages. // Loop through the files foreach ($p->importFile as $file) { // Set the file location $name = $file->data["basename"]; $path = $p->importFile->path; $location = $path . $name; // Get the file $json = file_get_contents($location); $json = json_decode($json); // Loop through the rows of the import foreach ($json->ttEntityDelAddrLink as $client) { // Create new page $new = new Page(); // Create unique hash $unique = md5(date("Y-m-d H:i:s") . "-" . $client->CustomerCode); // Set some variables for the new page $new->setOutputFormatting(false); $new->template = "_client"; $new->parent = $p; // Create hash $new->title = $client->DelAddressName; $new->name = $unique; // Page specific fields $new->company = $client->DelAddressName; $new->companyId = $client->CustomerCode; $new->city = $client->DelAddressCity; $new->address = $client->DelAddressStreet; $new->postcode = $client->DelAddressZipCode; $new->country = $countries[$client->DelAddressCountryCode]; // Save the page $new->save(); } // Exit for debugging exit; } Does anybody know what's wrong?
  6. I looked at this example and tested if it still included the unpublished pages, unfortunately it did.
  7. But does this answer the question why "unpublished pages are still shown"? I'm uncertain
  8. $streams = $page->child("template=_streams")->children("template=_stream"); This is the chain that I use to get the pages.
  9. Hey, I completely built this platform with ProcessWire (http://djmag.live/). It works fine except for the fact that some pages are still show, even when I change their state to "unpublished". They are still showing when they are returned through $object->children("template=_foo") or $pages->find("template=_foo"). Does anybody know what the problem might be?
  10. Hey, I made a hook that is triggered when a page with a certain template is saved. I meant to create the script only for the backend of the website. Now, whenever a page is saved on the front end (with the API) the module is being triggered. I was wondering if there is a method to have it only trigger whenever a page is saved on the backend (so not through the API). Jim
  11. Hey, I was wondering if there's a way to add more fields to specify when creating a new page. At the moment, the only two fields are required for creating a new page. Title Name (Automated) I've configured processwire so that the chosen page to create is limited to one template. Guess this would make the process to achieve the above a bit easier. Regards,
  12. Thank you for the response Horst. I looked into the documentation, yet I didn't find anything concerning sharpening of images. That's why I came here to ask. I will mask this as solved. But could you please be so kind to link me the page in which the sharpening topic is covered? Thank you in advance. Regards, Jim
  13. I have tried the above.. Unfortunately I do not see any improvement.
  14. Brilliant input, can I just add the sharpening option to the array, as following: $options = [ "upscaling" => true, "cropping" => false, "quality" => 100, "sharpening" => "medium" ];
  15. Hey, I was wondering if there is an alternative to the default Processwire ImageSizer. Although it comes in really, really handy (I have actually never used any Content Management Framework that comes with a default Resize module) I am not quite content when it comes to resizing large images. Check this image: http://imgur.com/KNS9VWB You can clearly see a difference in sharpness of both images, after resizing the image comes out a bit blurry (Yes, quality is on 100). Has anybody else encountered this? If so, is there any good alternative (in form of a Module). Much love to anyone that's willing to help <3
  16. Will it be able to have an option (when cropping) to contain a certain aspect ratio, or "is the technology not there yet"?
  17. There were two problems in my case. First problem was a conflict between a module I use called AIOM (All-In-One Minifier). The AIOM module caused an error just before the Page Protector module was triggered. When I enabled the debug logging I found out about this bug as there was no exception thrown. The second error was the way I structured the templates; I used one template file called main.php which automatically includes a controller and a view based on the template name. As there was no real template loaded, it created a blank error page. Although the chance is rare that someone will ever stumble upon the same errors as I did, I hope this might help someone out - someday.
  18. I fixed it by creating an actual login page (including template) to redirect to.
  19. @adrian, thanks for your input! I managed to debug and I got the module to work except for one little thingy. I checked "protect entire site" - yet when I destroy the user's session and direct them to the homepage. I found that when I redirect the user, the login template isn't popping up. Obviously this could be because the script redirects to the homepage. Is there a way to redirect the user to the login template? Thanks for your time, it helped me an awefull lot!
  20. Thanks for your reply, I will look into this after the weekend. Thanks for the debugging tips, hopefully I will find out the problem myself .
  21. Thanks for your reply. My settings are here: http://imgur.com/xjfRhvM. The code I am using for the login template are below: <?php // Variables $css = Wire("config")->urls->templates . "assets/css/styles.css"; $favicon = Wire("config")->urls->templates . "assets/img/favicons/favicon.ico"; ?> <!DOCTYPE html> <head> <title>Login</title> <meta charset='utf-8' /> <link rel='stylesheet' href='$css' type='text/css' /> <link rel='shortcut icon' href='$favicon'> </head> <body class='login'> <div class='full-size'> <div class='container'> <div class='protected-mode-container'> <div class='top'> <h1>Inloggen</h1> </div> <form class='protectedModeForm' action='./' method='post'> <p>Lorem ipsum dolor sit amet, con sectetuer adipiscing elit. Aenean commodo eupio ligula eget dolor.</p> <input type='text' class='input' name='username' placeholder='Naam' value='' /> <input type='password' class='input' name='pass' placeholder='Wachtwoord' value='' /> <button type='submit' class='button' name='login'>Login</button> </form> </div> </div> </div> </body> </html> It's just really weird that even if I destroy all sessions, it won't let me visit this login page. Hope we can work this out, thanks for your time Don't mind the non-echoed variables (stylesheets).
  22. Using ProcessWire 2.7.2 by the way.
×
×
  • Create New...