Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/02/2016 in all areas

  1. From the module readme... And you can also use the core Autocomplete inputfield to add pages on-the-fly providing the conditions on the "Input" tab are met...
    3 points
  2. It could certainly be improved, but here you go. I'll probably not going to release it officially, so if someone would like to take a shot at it, feel free. WireMailTesting.zip
    3 points
  3. I've just created a custom WireMail module, which does currently plainly logs all method calls and it's parameters to a logfile. I simply installed that one locally and WireMailSmtp on the live site.
    3 points
  4. good catch @flydev never considered this as most of my projects are multi lang tested and pushed your fix, should work now @csaeum Please let me now if it works for you, too EDIT: Just bumped version so you should be able to just update the module using ProcessWireUpgrade module (if installed)
    2 points
  5. You're using the ProcessWire namespace in that file, therefore you need to declare files explicitly as not part of your current namespace: <?php namespace ProcessWire; // … $fb = new \Facebook\Facebook([ 'app_id' => 'the_id', 'app_secret' => 'the_secret', 'default_graph_version' => 'v2.5' ]); As you seem to use pw 3.0 you could also use composer instead of manually including the package.
    2 points
  6. @Matt_P How about this one? http://blog.mauriziobonani.com/processwire-basic-website-workflow-part-2/ This is part of a four part tutorial: http://blog.mauriziobonani.com/tags/#processwire
    2 points
  7. If I understand correctly, the Mail panel in Tracy should be what you are looking for. It intercepts all wireMail() calls and shows the results in the panel instead of actually sending the emails. Oops - sorry about repeating the content of @szabesz's post - I replied without reading through all the replies which were on the next page.
    2 points
  8. @szabesz is correct. The language option on the User is for the backend access only. @A.Schmidt your setup is correct. When the guest user access the homepage using just "/' Processwire will show the default language, in this case, English. Using "/de" will show German. This is how PW works. And there is no redirect either. If you want to redirect based on browser settings and other stuff, there is a module for that . But I don't recommend it as it a UX flaw in most cases, so you have to be careful.
    2 points
  9. Just for the record: Adrian's Tracy Debugger module has smiliar features:
    2 points
  10. Can you share it?
    2 points
  11. Others with more experience in this field might correct me, but I do not think that Admin -> Access -> Users -> guest -> Language is for changing the default language of the frontend. It is for backend only. Since a guest user cannot access the backend, it is kinda useless in this case. But I might be mistaken. Anyone else?
    2 points
  12. To be correct: Install pim, what installs pim1, go to modules / site, install pim2 and use pim2load(). It needs a rewrite someday for recent PW versions (2.8+ & 3.0+)
    2 points
  13. Hi, no, it isn't possible currently out of the box. You can hook into the ___send() method, and add / change the line 705, where the message normally will be send. Don't know if this is an easy task, as the method is really huge. I find this useful too, and add it to the feature request list of the module, but don't expect an early release.
    2 points
  14. Thanks @netcarver and @dab! I'll update the code with your additions @netcarver.
    2 points
  15. Hmm all looks good so far. One question - have you set the Textformatter on the field you wanna use this?
    2 points
  16. @SoapyDaz. Welcome to the forums I can only guarantee that it works in 2.7x...Others have reported issues regarding PW 3+. I am waiting for a stable release of PW 3+ before I officially support the module for that version.
    2 points
  17. I'm using the Eventbrite API to output events but ideally I'd like to create and update pages for each event (so each event on Eventbrite has a page on PW); these should be read-only so only data is taken from EB and not editable on PW. I reckon it'll be fairly easy to create the pages... I guess it's the checking 1) if the page already exists and 2) if any content has changed. This is a job on offer and would like some idea of cost and if it's possible.
    1 point
  18. Greetings Everyone, ************************************************* ************************************************* EDIT NOTE: This post started as a work-in-progress discussion as I was working out the elements of a successful form. After contributions from participants in this discussion, the code below has been tested and works well. You can use the code as shown below in your ProcessWire templates! Feel free to follow up with additional quesations/comments! ************************************************* ************************************************* I have successfully built front-end forms with ProcessWire to add pages via the API. It works great -- until I had to include image uploads along with the "regular" form fields. Then it temporarily got a bit complicated. In this discussion, I show how to handle front-end submissions in ProcessWire with the goal of allowing us to create pages from custom forms. I then go a step further and show how to use the same form to upload files (images and other files). I'm hoping this discussion can illustrate the whole process. I know a lot of people are interested in using ProcessWire to do front-end submissions, and my goal for this discussion is to benefit others as well as myself! First, here's my original contact form (no file uploads): <form action="/customer-service/contact/contact-success/" method="post"> <p><label for="contactname">Name:</label></p> <p><input type="text" name="contactname"></p> <p><label for="email">E-Mail:</label></p> <p><input type="email" name="email"></p> <p><label for="comments">Comments:</label></p> <p><textarea name="comments" cols="25" rows="6"></textarea></p> <button type="submit">Submit</button></form> And here's the "contact-success" page that picks up the form entry to create ProcessWire pages: <?php // First, confirm that a submission has been made if ($input->post->contactname) { // Save in the ProcessWire page tree; map submission to the template fields $np = new Page(); // create new page object $np->template = $templates->get("contact_submission"); $np->parent = $pages->get("/customer-service/contact-us/contact-submission-listing/"); // Send all form submissions through ProcessWire sanitization $title = $sanitizer->text($input->post->contactname); $name = $sanitizer->text($input->post->contactname); $contactname = $sanitizer->text($input->post->contactname); $email = $sanitizer->email($input->post->email); $comments = $sanitizer->textarea($input->post->comments); // Match up the sanitized inputs we just got with the template fields $np->of(false); $np->title = $contactname; $np->name = $contactname; $np->contactname = $contactname; $np->email = $email; $np->comments = $comments; // Save/create the page $np->save(); } ?> This works great! After submitting the form, we go to the "Success" page, and new submissions show up in the ProcessWire page tree right away. Excellent! Now I need to add a photo field. I altered the above form so it looks like this: <form action="/customer-service/contact/contact-success/" method="post" enctype="multipart/form-data"> <p><label for="contactname">Name:</label></p> <p><input type="text" name="contactname"></p> <p><label for="email">E-Mail:</label></p> <p><input type="email" name="email"></p> <p><label for="comments">Comments:</label></p> <p><textarea name="comments" cols="25" rows="6"></textarea></p> <p>Click the "Select Files" button below to upload your photo.</p> <input type="file" name="contact_photo" /> <button type="submit">Submit</button> </form> And here's the updated "contact-success" page: <?php // First, confirm that a submission has been made if($input->post->contactname) { // Set a temporary upload location where the submitted files are stored during form processing $upload_path = $config->paths->assets . "files/contact_files/"; // New wire upload $contact_photo = new WireUpload('contact_photo'); // References the name of the field in the HTML form that uploads the photo $contact_photo->setMaxFiles(5); $contact_photo->setOverwrite(false); $contact_photo->setDestinationPath($upload_path); $contact_photo->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif')); // execute upload and check for errors $files = $contact_photo->execute(); // Run a count($files) test to make sure there are actually files; if so, proceed; if not, generate getErrors() if(!count($files)) { $contact_photo->error("Sorry, but you need to add a photo!"); return false; } // Do an initial save in the ProcessWire page tree; set the necessary information (template, parent, title, and name) $np = new Page(); // create new page object $np->template = $templates->get("contact_submission"); // set the template that applies to pages created from form submissions $np->parent = $pages->get("/customer-service/contact-us/contact-submission-listing/"); // set the parent for the page being created here // Send all the form's $_POST submissions through ProcessWire's sanitization and/or map to a variable with the same name as the template fields we'll be populating $np->title = $sanitizer->text($input->post->contactname); $np->name = $np->title; $np->contactname = $sanitizer->text($input->post->contactname); $np->email = $sanitizer->email($input->post->email); $np->comments = $sanitizer->textarea($input->post->comments); $np->save(); // Run photo upload foreach($files as $filename) { $pathname = $upload_path . $filename; $np->contact_photo->add($pathname); $np->message("Added file: $filename"); unlink($pathname); } // Save page again $np->save(); ?> <p>Thank you for your contact information.</p> <?php return true; } else { ?> <p> Sorry, your photo upload was not successful...</P> <?php } ?> Replace the field references with your own field names, make sure to change the various paths to match yours, and change the various messages to be what you need for your project. Read the entire discussion to see how we worked through getting to the solution shown above. Thanks, Matthew
    1 point
  19. @csaeumIf you install ProcessWire multi-language support, it should work @Can maybe this small check could help, on line 78/79 if($this->wire('modules')->isInstalled('ProcessLanguage')) { $userLanguage = $this->wire('user')->language; $lang = $userLanguage->isDefault() ? '' : "__$userLanguage->id"; } else { $lang = ''; }
    1 point
  20. @Beluga I just pushed a new leaflet-v1.0.0rc2 branch to my repo - works nicely. @ceberlin If you were referring to my work above, please try out the v1.0.0rc2 branch as it pulls the files in from the npmcdn you referenced in your quote.
    1 point
  21. Well, I did not explain it properly by saying "same behavior as before". Before what? Sorry for this! What I meant was that it is back to normal, it works as it used to work in previous versions before you had "made it disappear"... I do get "Template compiling is disabled, so the variables could not be determined." in the panel. Huh Isn't it faster if you do a search on the page(s) in the browser? You get all the words "template" highlighted and can just fix them. There aren't too many
    1 point
  22. Sorry I think I must not be understanding the scenario you are seeing - any chance on sending through a screenshot or two highlighting what you are seeing and how you think it should be different. Unfortunately I haven't been able to figure out how to make template file variables available in the Console panel - I have tried a couple of times without success, but it is definitely on my list to revisit because it is definitely a significant limitation at the moment. I can get them (like I do in the Variables panel), but can't persist them, but it's still on my list of things to do, so I will be taking another look at it. Thanks - I don't suppose you'd be willing to make a list of those places where it's incorrect for me?
    1 point
  23. I'd return a hashed id – two way hashing, just to to disguise the real id – with the ajax call and put that one in a hidden field.
    1 point
  24. What a pitty, just found this http://meta.stackoverflow.com/a/329022/3484824 and PW got 16 questions so far :/
    1 point
  25. You mean $this->config in LinkCrawler.php? Would say it looks quite good, I put a var_dump($this->config) on line 151 (right after $this->config has been populated) and I'm getting this in the error message after clicking on check now on /processwire/setup/link-checker/ Don't now what you mean? Here /processwire/module/edit?name=ProcessLinkChecker right? don't know what I have to look for?! No but for the tests I exit; right afterwards and those lines are the very first lines right after opening php and bootstrapping pw.. Thanks for your workaround @arjen think I'll give it a try soon
    1 point
  26. Thanks for mentioning those issues with the Variables panel. The latest version deals with this in a better manner - let me know your thoughts on the new behavior. Some other changes in this/recent versions. You can now use bd() in the Console Panel You can now trigger the Mail, Page Recorder, and Event Interceptor panels from the Console Panel - really nice for testing your mailing / page creation code from the console The PW and Tracy log panels are now included in the AJAX debug bar
    1 point
  27. The backslash did the trick. Thank you, LostKobrakai.
    1 point
  28. Thanks @Sérgio ! @A.Schmidt Recommended searches on the subject: allintext: language site:ProcessWire.com/blog site:processwire.com/talk default language
    1 point
  29. Hi @Gazley, just discovered, if the field is not autojoined, it is possible to use: {{ page.get("body") }} and it works as well. Doh!
    1 point
  30. Ok, so I just install pim1 and write pim2Load().
    1 point
  31. Hi. There are no plans to update Pim2. And if it will be updated, the version number from Pim1 will be bumped up, so that it shows up in the update modules list. (Pim2 is handled as submodule of Pim, Pim1)
    1 point
  32. Taking another look at this after a cup of coffee. While I still have no idea what's going on in your site, here's another workaround you could try, though you'll first have to grab the latest version of ProcessVersionControl.module from GitHub. Then add the following to the beginning of the /site/templates/admin.php file: $this->addHookBefore('ProcessVersionControl::executePreview', function(HookEvent $event) { wire('modules')->get('Spex')->setActivePage(null); }); This resets the active page for Spex right before ProcessVersionControl renders it, which in turn should make Spex behave as expected in this situation. If this works, it's probably the cleanest you can get without modifying either Spex or ProcessVersionControl manually (neither of which I'd recommend doing). Hope this helps.
    1 point
  33. oh my... Still have so much thing to learn... Thanks it works now.
    1 point
  34. "Missing required value" is a translatable phrase. I haven't used translations before myself as all my sites are in English, but I believe the process is: Setup > Languages > [your language] > Translate File (under Core Translation Files) > \core\InputfieldWrapper.php I created a GitHub issue regarding the obsolete code example in /wire/config.php
    1 point
  35. the profile itself has a $useDone variable, so you can also just set that to false and load your alternate file. /* * Whether to include the _done.php markup file? For example, your template * file would set it to false when generating a page for sitemap.xml * or ajax output, in order to prevent display of the main <html> document. * */ $useDone = true; in other scenarios you can stop what happens after the template by using: return $this->halt(); so therefore you could use wireRenderFile, or include/wireIncludeFile your alternate file, and then prevent loading _done by halting.
    1 point
  36. I don't follow you here. If min width/height is 320/260 and max width/height is 1600/1600 (or empty) then a 320x260 image can be uploaded. The image must be smaller than the minimum to be refused - equal to the minimum is accepted.
    1 point
  37. Where is _done.php coming from? If you look at Ryan's CMS Critic case study, he shows how you can make an "$includeMain" variable; are you using $page->render() or wireRenderFile() for the content of your url segment pages?
    1 point
  38. @Mats @gebeer Thanks to a job I just finished for @dab I have been actively taking your work forward. I have a fork of the project here that... Simplifies getting the needed files used by MarkupLeafletMap into a template's header Integrates the Leaflet.AwesomeMarkers project and the latest FontAwesome icons into the module Adds a callback function for customising the content's of a marker's popup box Adds a callback function for customising the visual appearance of any marker Updates the readme file significantly Provides an example template file to help get folks underway with this module in their projects I based my work on gebeer's extension of your repo Mats, so I have issued a pull request to gebeer - but I'd like to get these changes into your repo if possible as then we can revert to your repo as the master codebase and, hopefully, have the latest goodies straight from the PW module directory. It's now very easy to add fields to the marker pages that let you customise their appearance. Below I have added an Options field, a FieldtypeFontIconPicker and a Text field to control the marker visuals via the added callback. If anyone want's to try it out, here is the link to the zip file.
    1 point
  39. A series (currently 10 episodes) of video tutorials in German by Leonid Lezner https://www.youtube.com/channel/UCwkKKtIeOzfIqF8X5gNP0_g
    1 point
  40. This is my most ambitious PW site yet: http://vroom.pt It's an auto ad portal specially designed towards professional dealers. Some highlights you can't really see just browsing the website: Custom CMS for dealers (screenshot); Auto generated, customizable website for each dealer (examples here and here); The dealer can choose between a dark or light theme, then set a tone color; More themes will be added in the future with completely different designs. Optimized search algorithm to keep speed reasonable even when searching through thousands of results.
    1 point
  41. Just to add that here. The driver can be installed manually until and if the pr does get merged into valet. Just put the ProcessWireValetDriver.php of the pr into the ~/.valet/Drivers folder and start your ProcessWire project.
    1 point
  42. Both versions work independent, you could even use multiple language alternative textfields aside of a different textfield, which is setup to be multi-language.
    1 point
  43. maybe i'm wrong, but so far I see this should function. /** * Does this page have the specified status number or template name? * * See status flag constants at top of Page class. * You may also use status names: hidden, locked, unpublished, system, systemID * * @param int|string|Selectors $status Status number, status name, or Template name or selector string/object * @return bool * */ public function is($status) { if(is_string($status) && isset(self::$statuses[$status])) $status = self::$statuses[$status]; return $this->comparison()->is($this, $status); }
    1 point
×
×
  • Create New...