Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/21/2017 in all areas

  1. I finally re-launched Notanotherdotcom - my business website. Things were looking a little dated for a few years, but finding some spare time to give it an overhaul was difficult (I'm sure that resonates with a lot of people here). There's still more content to go on. I'm working through some more recent projects to put on the portfolio but I want to do a bit of a write-up for each one rather than just keep putting up isolated screenshots without much description of what work actually went into each project. It also has a blog where ProcessWire will definitely get a mention. I started writing the second article yesterday, titled "A Better CMS", but when I finally settled on my 3 main reasons for using ProcessWire it quickly began turning into 3 separate blog posts, so keep an eye out for those.
    11 points
  2. I guess Zuckerberg got mocked too at the beginning But ... no It's https://www.docpaddock.com and live today !! I have to communicate on that here, in another section I guess, will do it this week I thank PW and all its very friendly community in the about page : https://www.docpaddock.com/en/motogp/about/ You really helped me build this up guys ! I knew nothing about PW a few months ago.
    5 points
  3. No, it's not the permissions. You're doing everything properly. I never tried this module with axios before, therefore this error is new to me. It turns out that axios sets the Content-Type header to application/json;charset=UTF-8 instead of application/json. That's where the problem was, because the ProcessGraphQL module would parse json payload only if Content-Type was set to just application/json. I changed the behavior and now it will look to your query in json payload if Content-Type contains application/json string in it. Please grab the latest version of the module and try again. It should work now. Thank you for taking time to report the issue.
    5 points
  4. Today I have been running in mysql errors using @renobird s Module MarkupActivityLog which still uses mysqli Driver. @all developers Although mysqli is still supported PDO driver is the default database driver in PW since https://processwire.com/about/news/introducing-processwire-2.4/ and its strongly recommend to all module authors to use/change-to PDO driver instead of mysqli. @renobird I have sent a pull request. A list of other affected modules not updated until now. (I try to keep them up to date. Please help) @apeisa ProcessTrashman, ProcessRedirects @netcarver ProcessDiagnostics
    4 points
  5. Just wanted to say thanks for your work. You and @Nurguly Ashyrov are the people with projects who made me interested in ProcessWire. This outdated website doesn't give the best impression, but after a few FAQs and your threads, man am I interested.
    4 points
  6. I am happy it works now . The plan is to add support for all core fieldtypes. That includes RepeaterField also. I will try to keep everyone updated via this thread, and you can also keep with the changelog.
    4 points
  7. Now it works!! This is so cool...I wish I could like this thread twice :). Do you have any plan of adding the RepeaterField? I don't know if it has been mentioned in this thread yet, but I found this cool GraphQL tutorial that may be useful for someone new to GraphQL. When I learn GraphQL properly I'll test this module more, as I think it has huge potential for introducing FrontEnd devs to ProcessWire.
    4 points
  8. Depends on the strategy that you are using , but you can do this on the top of your home template: if($user == $users->get("you")) { include("alternative_home_file.php"); return; }
    3 points
  9. For simple static sites you can use a javascript based approach like http://lunrjs.com/ Also, check https://www.algolia.com/ for a more powerful solution, although in this case a more complex solution to implement depending on your needs.
    2 points
  10. Thanks @alan! I'm a happy CodeKit user too. Since I do not start a new frontend project too often, I keep forgetting all the related cli stuff (commands, updates, incompatibility issues, etc..), that is why I stick to CodeKit. For me, CodeKit is the timesaver.
    2 points
  11. No need, @Cesco. You can do this on your current installation. To use Italian as your default language on the frontend, and considering your want "example.com/" to open in Italian and "example.com/en/" to change to English, do the following: As this is a new installation, and you have no real data yet, delete all languages but the default one, of course. Change the default language title to Italiano Upload Italian translation files to it Create a new language, name "en", title "English" Edit the homepage and set the "en" language as active and the url as "en".
    2 points
  12. Users are 'just' pages. Looking at the 'pages' table structure/schema, the id column is of type INT unsigned. So, unless you will have more than 4,294,967,295 pages in your site, you will never experience any issue. https://dev.mysql.com/doc/refman/5.7/en/integer-types.html
    2 points
  13. 2 points
  14. @Gideon So the way that i have handled this in the past was to use an extended version of the select, which adds a data-description atttribute to the selectable items. Once you have that attribute (which would get it's value from a data-description field), then you can use jQuery to replace the description with the new value, once it is selected. these topics may be of help:
    2 points
  15. Maybe this: https://processwire.com/blog/posts/introducing-tracy-debugger/#template-path-panel
    2 points
  16. Welcome to PW! Use the autocomplete inputfield: http://modules.processwire.com/modules/inputfield-page-autocomplete/ Let us know if you have any problems with it.
    2 points
  17. In case anyone else encounters this, I am developing a site and using CodeKit.app. Under some circumstances CodeKit was re-processing files once per 2 seconds when it should do it only when it sees an edit made by me to a .scsss or .js file etc. The answer was to get CodeKit to ignore /site/assets/ As usual the dev for CodeKit was super-fast to make suggestions and one of those lead me to the fix. Thanks Bryan @ CodeKit Edit 2017-09-07 TL;DR; alt-click folder `assets` and choose 'Skip This Folder' (LH pane) not 'Set Output Actions' (RH pane). I was getting this happening again but wasn't able to stop it - it turned out I was attempting to tell CodeKit to ignore files the wrong way(?) or at least in a way that failed. With the `assets` folder selected in CK I was clicking 'Set Output Actions' in the RH column and it appeared to stop the constant refreshing but actually that was a 'red herring'; actually what I needed to do was alt-click the `assets` folder (LH panel) and choose `Skip This Folder'. Solved ?
    1 point
  18. Let's focus on solving the problem without making too many assumptions.
    1 point
  19. the last post was just how to do it in formbuilder, so not relevant, and i removed that link...
    1 point
  20. @danielsl I noticed this so I looked at the code more closely. I modified it to this, where it checks if the form has been sent, then validates, if the fields are ok, it checks whether recaptcha has been done. <?php require(dirname(__FILE__) . "/../../vendor/vlucas/valitron/src/Valitron/Validator.php"); require(dirname(__FILE__) . '/../../vendor/google/recaptcha/src/ReCaptcha/ReCaptcha.php'); $googleSiteKey = 'xxxxxx'; $googleSecretKey = 'xxxxxx'; $contactFormRecipient = 'my_email'; $contactPageID = '1022'; $v = new \Valitron\Validator(array( 'name' => $sanitizer->text($input->post->name), 'email' => $sanitizer->email($input->post->email), 'message' => $sanitizer->text($input->post->message) ) ); $v->rule('required', ['name', 'email', 'message']); $v->rule('email', 'email'); if ($input->post->sendMe) { if ($v->validate()) { $reCaptcha = new \ReCaptcha\ReCaptcha($googleSecretKey); $resp = $reCaptcha->verify($input->post->{'g-recaptcha-response'}, $_SERVER["REMOTE_ADDR"]); if ($resp->isSuccess()) { $name = $input->post->name; $email = $input->post->email; $message = $input->post->message; $message = " <html> <body> <p><b>From:</b></p> <p>{$name}</p> <p><b>Email:</b></p> <p>{$email}</p> <p><b>Message:</b></p> <p>{$message}</p> </body> </html>"; $mail = wireMail(); $mail->to($contactFormRecipient) ->from($email) ->subject('Contact form submission') ->bodyHTML($message) ->send(); $session->flashMessage = '<h2>Thanks for the message. I will get in touch with you shortly.</h2>'; $session->sent = true; $session->redirect($pages->get($contactPageID)->url); } else { $session->flashMessage = '<h2>Recaptcha must be complete.</h2>'; } } else { $session->flashMessage = '<h2>Please fill out the fields correctly.</h2>'; } } ?> <div class="body-row"> <div class="wrapper"> <?php if($session->flashMessage):?> <div class="alert <?=!$session->sent && (!$v->validate() || !$resp->isSuccess()) ? 'alert-danger' : 'alert-success'?>" role="alert"> <?php echo $session->flashMessage;?> </div> <?php endif;?> <form id="contact-form" method="post"> <div class="<?=$v->errors('name') ? 'has-error' : ''?>"> <label for="name">Name (required)</label> <input class="form-control" name="name" id="name" type="text" value="<?=$sanitizer->text($input->post->name)?>"> </div> <div class="<?=$v->errors('email') ? 'has-error' : ''?>"> <label for="email">Email (required)</label> <input class="form-control" name="email" id="email" type="text" value="<?=$sanitizer->text($input->post->email)?>"> </div> <div class="<?=$v->errors('message') ? 'has-error' : ''?>"> <label for="message">Message (required)</label> <textarea class="form-control" name="message" id="message"><?=$sanitizer->text($input->post->message)?></textarea> </div> <div> <!-- Google Recaptcha code START --> <div class="g-recaptcha" data-sitekey="<?=$googleSiteKey?>"></div> <script type="text/javascript" src="https://www.google.com/recaptcha/api.js"> </script> <!-- Google Recaptcha code END --> </div> <div class="centered"> <button type="submit" name="sendMe" value="1">SEND MESSAGE</button> </div> </form> </div> </div> <?php $session->remove('flashMessage'); $session->sent = false; ?> Maybe not the best solution but it seems to work. Maybe some other members can help clean up my logic. Anyway, hope this helps.
    1 point
  21. 1 point
  22. Also check this code example where Ryan shows how to create pages using the API. It's pretty simple!
    1 point
  23. I don't have a code example for this, but if you look at these two modules by Ryan, you can do it: http://modules.processwire.com/modules/markup-rss/ http://modules.processwire.com/modules/rss-feed-loader/ And schedule the export/import with http://modules.processwire.com/modules/lazy-cron/ Also check this module: https://processwire.com/blog/posts/introducing-iftrunner-and-the-story-behind-it/#iftrunner-release
    1 point
  24. i guess the browser strips your form because it is inside the processwire form that contains all the inputfields and a form inside another form is not valid html. the inspector shows you the code after browser and javascript manipulations. if you view the raw sourcecode you maybe see your form element. http://stackoverflow.com/questions/555928/is-it-valid-to-have-a-html-form-inside-another-html-form
    1 point
  25. Thanks diogo. I'm referring to https://processwire.com/api/selectors/ under the section, "Subfield selectors". It says, " "If you instead want to find all pages that have at least one building greater than 1000 feet that also happens to be built before 1980 (matching the same exact building, even if the page has multiple buildings) then you can specify that in the selector by preceding the field name with a "@", i.e." "@buildings.feet_high>1000, @buildings.year_built<1980" I was slightly wrong in describing the way it is functioning. R.a.count doesn't matter, so I've removed it from the string and tried both, "@R.b.count=0, @R.c.count=0" and, "R.b.count=0, R.c.count=0" Both return the same results, pages that have either R.b.count=0 OR R.c.count=0, or both=0. What I need is pages that R.b.count=0 and R.c.count=0 where both R's are the exact same R. In other words, pages that have an R where b.count=0 AND c.count=0.
    1 point
  26. No need for excuses, adrian - it's fine to see different options. I'm not a Tracy user up to now, but might get it soon...
    1 point
  27. @Doc - the other option in Tracy is the ability to edit the page's template directly - you don't even need to post a different version: https://processwire.com/blog/posts/introducing-tracy-debugger/#template-editor-panel Just edit through the Tracy interface and click "Test". That will reload the page with the changes you have made without affecting how it looks/works for other users. Whether I use this or the Template Path Panel that tpr mentioned depends on the complexity of the changes I am making. The Template Path Panel option allows you to swap between various versions similarly to diogo's code, but through the Tracy debug bar GUI.
    1 point
  28. Ditto szabesz; I would love to get into that lower-level approach and one day maybe I will get there, until then I have CodeKit to keep me warm
    1 point
  29. Ok, there is now a new config option that needs to be checked to show the action code. On an unrelated note, I also revamped the recent $noBackup option. This is a breaking change, but now you can set: protected $dbBackup = 'automatic' (or 'optional', or 'disabled') in your custom actions to override the default behavior as defined in the module config settings. Hopefully this will be a helpful change.
    1 point
  30. Codekit is a good tool for web development and i was an old codekit user. I started to use npm + gulp + bower, now this is better solution for me.
    1 point
  31. No idea what is happening there No errors here on latest PW dev and latest AOS, default and Reno themes. Cache? Edit: have you added CKEditor buttons to the body field before AOS? Sometimes that can cause JS errors, re-saving the field usually helps.
    1 point
  32. I have 4728 users right now on my project. No problem so far.
    1 point
  33. Nothing. The users page is a lister with pagination and the quick access navigation does at some point switch to showing just the available user roles and the number of assigned users for each one instead of all the available users.
    1 point
  34. This one! Thanks @szabesz
    1 point
  35. Replace this file until module update. AdminOnSteroids.min.js
    1 point
  36. Thanks! Works perfectly (little adjustment "?" to avoid passing through of query). I've seen this solution in your former post but hoped there is a more direct way
    1 point
  37. You could also get the images directly from the assets/files directory with PHP.
    1 point
  38. Hi @kater, you're most welcome. A plain query string request to the root of the site won't get caught by Jumplinks. You would be better off using htaccess to convert these to request URIs and then having Jumplinks process them. RewriteEngine on # These should go directly after the above RewriteCond %{QUERY_STRING} ^q=(.+)$ [NC] RewriteRule ^$ /%1 [R,L] (Haven't actually tested it, but it should redirect /?q=something/else to /something/else with a 302 status code.) Then omit ?q= from the source.
    1 point
  39. It seems that the Maximize plugin replaces the DOM entirely and there's no Save button at all. My only idea is to trigger a click on the pushed Maximize button which works, though the transition to the non-maximized state is visible for a few milliseconds.
    1 point
  40. @adrianThank you for your help. Your addition works for me But this does not solve the overall question to hide pages from the menu for specific user groups. So if anyone has suggestions... well ... write them.
    1 point
  41. Guests should be able to upload. I am not sure what's happening in your case. Just to be sure, I've double checked in PW 2.7, 2.8 and 3. Guests (meaning frontend users not logged in [anonymous if you like]) can upload just fine. There's no issue with the module nor with ProcessWire (I believe) in this case . There's something else going on in your install I suspect. Some setting or hook or similar?
    1 point
  42. Here's a JS demo: https://jsfiddle.net/abdennour/oh3jL82j/ Not knowing your exact scenario, but I think a purely JS solution would be better unless you have a LOT of children that you are doing the getRandom on. If you really want to go the AJAX route we can help you further, but it's really a PHP issue, rather than PW so googling around would be pretty helpful. The only catch with PW and AJAX is that the URL for the ajax request can't be directly to a php file in /site/templates - the file either needs to be outside /site or you need to assign the file to a PW template and page call the url for that page. Sorry for the short answer - I am a little rushed at the moment.
    1 point
  43. Because your click action is client side (javascript) and the getRandom is server side (php), you will either need to get all the options initially and do the random filter using javascript, or you would need to do an ajax call on each click and return another set using getRandom. Does that make sense?
    1 point
  44. Listers are real pages - take a look - see the "Test Lister" at the bottom? Just move to directly under "Admin" Ok, so I guess it's back to the drawing board Let me take a look at your hook code and see if I can get it working for you.
    1 point
  45. I have edited the github repository, now ProcessVue is a site profile and you can install it easily. Just note that the REST API may have bugs...I don't even remember how it works
    1 point
  46. I would also love to see this - I think it would be great if we could define it in a Github repo changelog.md file and have the automatically imported into the text in the modules directory, and perhaps even displayed in the module info within a PW install. Perhaps it would even be nice to have a way to add a flag about breaking changes that would show up in the ProcessWire Upgrades module so you are warned before upgrading. @ryan - any thoughts on this? I'd be happy to work on it - obviously I could do the PW side of it from the repo, but would need access to the php files for the modules directory to make that side of things work.
    1 point
  47. Hmm... When I try this with templates I get the error "You must save Fieldgroup 'X' before adding to Template 'X'" It seems like that would be the job of the setImportData() function to make sure that happens? Edit: Got it. Here's the template builder: protected function buildTemplatesFromJson($json) { $data = is_array($json) ? $json : wireDecodeJSON($json); // Loop through each template in the JSON foreach($data as $name => $templateData) { unset($templateData['id']); // Get rid of the ID so it doesn't conflict with the new installation $template = $this->templates->get($name); // If the template exists, grab it // Create the template if it doesn't already exist if(!$template) { $template = new Template(); $template->name = $name; } $template->setImportData($templateData); // Import the data for the field $fieldgroup = $template->fieldgroup; $fieldgroup->save(); $fieldgroup->saveContext(); $template->save(); if(!$template->fieldgroup_id) { $template->setFieldgroup($fieldgroup); $template->save(); } } }
    1 point
  48. You just get the textformatter module and use the formatValue(). It accepts Page, Field, String but you can also pass an empty page and field as most textformatters also don't use it except HannaCode I think. $str = $page->textfield; $modules->TextformatterModuleName->formatValue(new Page(), new Field(), $str); echo $str; This is deprecated, but should work for most textformatters still $str = $page->textfield; $modules->TextformatterModuleName->format($str); echo $str;
    1 point
  49. I had the need of iterating through a lot (and I mean A LOT) of pages by template, and was also having memory problems. With this amount of pages it was becoming really annoying to do it few at a time, so I came up with a solution that doesn't need a wireArray. With this I could iterate over more than 50.000 pages with the same template on a website with more than 100.000 pages by bootstrapping PW from the command line. I just had to set a time bigger limit to PHP with set_time_limit(), and everything went fine and without interruptions. while (1) { $p = wire('pages')->get("template=my_template, id>$id"); // get page with id bigger than previous if(!$id = $p->id) break; // assign current page's id to $id or break the loop if it doesn't exist // do stuff using $p as the current page wire('pages')->uncacheAll(); // clean the memory (with $p->uncache() doesn't work. why?) }; edit: actually, using the command line I don't think set_time_limit() is even needed.
    1 point
×
×
  • Create New...