Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/12/2016 in all areas

  1. Don't know about performance, but with this code you would set the value of $my_page_array to 1234 which most likely would throw an error. For comparison use $my_page_array === 1234 If you have the $page object that you are searching for already, you can also pass that directly into the has() method like $my_page_array->has($page) instead of $my_page_array->has("id=1234")
    5 points
  2. Why not make this a community funded module? I'd be more than happy to contribute to financing it.
    4 points
  3. I think this is good idea. Personally I have a number of module ideas but have no firm idea what to prioritise. Something like this would be of benefit to me. As for a calendar module, I have been working on something for a while now. These are very old screenshots and will change. The module was based on dhtmlxScheduler but that will definitely change. Maybe I should release this module next
    4 points
  4. Support thread for WireMail Mailgun. For bug reports, please use the bug tracker on GitHub. https://github.com/plauclair/WireMailMailgun
    3 points
  5. This week we've been focused on one of the major 3.x roadmap items, which is to have strong Composer support in ProcessWire. In this post, we now have an outlined process and a full proof-of-concept module built to demonstrate it all, plus info on how other module authors can support Composer as an alternative installation method. To add to that, we get into Google's Client API with a new 3.x specific module and how to connect Google's Calendar services with ProcessWire. https://processwire.com/blog/posts/composer-google-calendars-and-processwire/
    3 points
  6. A new version is uploaded to GitHub. This release fixes JS dependencies as all required JS files are loaded via the main JS file, only if they aren't present. Furthermore, CSS files are also loaded by the main JS. Main changes: new option: disable autoloading FrontEndEditLightbox.js. This enables loading it manually, for example when using a script loader. new option: custom data-* attributes feature. Can be useful for further JS/CSS processing (eg. ajax reload parts using FEEL callbacks) load jQuery and Magnific Popup by FrontEndEditLightbox.js (only if they aren't loaded) added simple ajax reload implementation exampe to the readme file
    3 points
  7. Module (version 002) now in modules' directory http://mods.pw/BN
    2 points
  8. I ended up making a ton of mods to this for things that were very specific to our needs. Coincidentally, I worked on cleaning it up and getting it back to a more releasable state earlier this week. I'll take a look at it on the devns branch on Monday/
    2 points
  9. Hi Guys I really like the Form API of Processwire, it is really flexible. You can build from a simple contact form until to a complex registration form in a short time without using HTML. The only "flaw" which I encountered is. The bigger the form is, the bigger the code gets and this can be frustrating when you are building forms with more than 20 Inputfields. The code gets longer and readability gets lost over the time since it is a (almost)self repeating process of "codeblocks" where the structure is almost always the same. So I decided to write up a simple class to "minify" the code when building forms with the form API. How does the class work? It is a very simply class where you create a new (didn't know how to name the class ^^)ProcessForm Object and get the InputfieldForm Object with the getFormObject() function. Now you can call the addInputfield() function to create any kind(not are all supported, only the simple ones) of Inputfield. And at the end you can render the ProcessForm object which basically calls the render() function of the InputfieldForm class. <?php $form = new ProcessForm("./contact", "post", "contactform"); //default ("./", "post", "ProcessForm") $form->addInput(array( 'type' => "InputfieldText", 'label' => "First Name", 'attributes' => array('id' => "firstname", 'name' => "firstname"), 'required' => 1 )); $form->addInput(array( 'type' => "InputfieldRadios", 'label' => "To much code for a simple Form?", 'options' => array('yes' => "Yes, absolutely", 'no' => "No, absolutely not"), 'attributes' => array('id' => "tomuchcode", 'name' => "tomuchcode"), 'required' => 1 )); $form->render(); ?> Is this usefull? Honestly said, I don't know if this is usefull for you. It is usefull for me, since I can "minify" or have a better overview/readability over my code. PS: I am still learning PHP OOP, so dont hate me when my "oop skills" are too low. I'am very open to better approaches, tipps, suggestions to improve this class or go antoher way to manage the big amount of code when building big forms with API. PPS: The class isn't tested very well(or better said it isn't tested at all ^^) since I am to lazy to do tests. So don't use this in commercial projects(but when you want still using it commercial it is at your own risk ^^). The code is on Github Greetings Orkun aka "Nukro"
    2 points
  10. MediaLibrary Update: MediaLibrary can now be found in the official module list. Out of necessity, I've started to implement a simple media library module. The basic mechanism is that it adds a MediaLibrary template with file and image fields. Pages of this type can be added anywhere in the page tree. The link and image pickers in CKEditor are extended to allow quick selection of library pages from dropdowns. In the link picker this happens in the MediaLibrary tab, where you can also see a preview of the selected image. In the image picker, simply select a library from the dropdown at the top, everything else is handled by standard functionality. I've put the code onto github. This module is compatible with ProcessWire 3. Steps to usage: Download the module's zip from github (switch to the pw3 branche beforehand if you want to test on PW 3.x) and unpack it into site/modules Click "Modules" -> "Refresh" in the admin Click "Install" for MediaLibrary For testing, create a page with the MediaLibrary template under home (give it an expressive title like 'Global Media') and add some images and files Edit a differnt page with a CKEditor field and add a link and an image to see the MediaLibrary features in action (see the screencap for details) Optionally, go into the module settings for MediaLibrary Note: this module is far from being as elaborate as Kongondo's Media Manager (and doesn't plan to be). If you need a feature-rich solution for integrated media management, give it a look. Feel free to change the settings for MediaFiles and MediaImages fields, just keep the type as multiple. There are some not-so-pretty hacks for creating and inserting the correct markup, which could probably be changed to use standard input fields, though I'm a bit at a loss right now how to get it to work. I've also still got to take a look at error handling before I can call it fit for production. All feedback and pointers are appreciated (that's also why I post this in the development section). Edit 09.03.2016 / version 0.0.4: there's now also a "Media" admin page with a shortcut to quickly add a new library. Edit 01.05.2016: Version 0.0.8: - The module now supports nested media libraries (all descendants of eligible media libraries are also selectable in link/image picker). - There's a MediaLibrary::getPageMediaLibraries method you can hook after to modify the array of available libraries. - You can switch between (default) select dropdowns or radio boxes in the module configuration of MediaLIbrary to choose libraries. Edit 10.10.2018: Version 0.1.3: - Dropped compatibility for ProcessWire legacy versions by adding namespaces - Allow deletion of libraries from the Media overview admin page - Added an option to hide media libraries from the page tree (optionally also for superusers)
    1 point
  11. Hi, first of all I'd like to thank you all, and in particular Ryan, for this great project which is ProcessWire. I'm using ProcessWire for the first time and frankly I'm finding it quite good, despite my lack of experience. Anyway, I created this post to introduce you the following module, on which we are working, and I'd like to share it with the community which could benefit from it and maybe improve it. You can find the module here: https://bitbucket.org/mauro_mascia/processwire-social-login/ Basically, it adds the ability to allow a social login (using the HybridAuth library - https://github.com/hybridauth/hybridauth) as well as a standard login, user profile and registration. The module is clearly not complete and it is at its first stage of maturity and I hope you can forgive me if I have not fully complied with the PW best practices
    1 point
  12. I'm using symlinks too, but I use it for the /site/... folders only, because I do not work on the wire/... folders: /www/public_html/wire/ == is physically in the htdocsdirectory of apache /www/public_html/site/ == symlinked to e.g. /Users/me/myproject/site/ /www/public_html/index.php == is physically in the htdocs directory of apache
    1 point
  13. 1 point
  14. Thank you for sharing and the quick intro!
    1 point
  15. solved, I don't know why but the template had the option "Use Compiled File" off
    1 point
  16. Just made a v0.4 release and a new support thread over at https://processwire.com/talk/topic/12667-wiremail-mailgun/. I would really appreciate someone testing this on 3.0 and report how it's working, I don't have much time to test this out right now.
    1 point
  17. v0.4 release Small update with improvements on the addAttachment() method and an added validateEmail() method, using Mailgun's email validation service. https://github.com/plauclair/WireMailMailgun/releases/tag/0.4
    1 point
  18. Should $session->message persist? I have code that says otherwise, unless this is a bug? I'm just refreshing current page to show message. if($mail->send()) { $session->notices = false; $session->message('Thank you, your enquiry has been sent, we will be in touch shortly.', true); $session->redirect($page->url); } // render notices $data = array('notices',$notices); $partials['notices'] = $page->render('views/partials/_notices.php',$data); Event when revisiting the page after further navigation, the message remains. Weird. EDIT: Session.php line 117, has remove method commented out: // $this->remove($type); Enabling this solves the problem, just wondering why it would be commented out? After rendering notices on the front end I have to call: $session->removeNotices(); to force removal.
    1 point
  19. Then I request a kongondo module release subforum!
    1 point
  20. So, here we are. Sorry the actions are a little hectic in respect of the file size (though its still huge enough to get trouble with the forum upload). tried imgur now:
    1 point
  21. Yes you can read and write modules config data via PWs API for all modules. Please refer to the docs, or search the forum via google for something like $modules->get("WireMailSMTP")-> getConfigData(), or readConfigData() ? and ->writeConfigData($data). Sorry, I'm on mobile and cannot provide links or exact code snippets ATM. ---- EDIT: you can use this: $data = wire('modules')->getModuleConfigData("WireMailSmtp"); // or, regarding on scope, $data = $modules->getModuleConfigData("WireMailSmtp"); after modifying, you can write it back: wire('modules')->saveModuleConfigData("WireMailSmtp", $data); // or $modules->saveModuleConfigData("WireMailSmtp", $data);
    1 point
  22. I managed to fix this problem and now I have the Editor Protocol Handler working with Eclipse. Here comes what I did: I followed the document here: http://teleyag.com/blog/2011/08/19/openineclipse-url-scheme-for-mac/. The only change was to fix that urlencoding problem above with the following AppleScript change. On line 6 I added: set this_URL to replace_chars(this_URL, "%2F", "/") And in the end of the script this function for replace_chars: on replace_chars(this_text, search_string, replacement_string) set AppleScript's text item delimiters to the search_string set the item_list to every text item of this_text set AppleScript's text item delimiters to the replacement_string set this_text to the item_list as string set AppleScript's text item delimiters to "" return this_text end replace_chars
    1 point
  23. Yes, fantastic! Ryan, Hari KT and anyone else hiding behind the scenes; thank you.
    1 point
  24. I'm not sure why you'd need sql for that. Sql queries cannot supply you with a datastructure like you suggested it, it can only return data in a tabular structure, so you need to build up the array no matter how you tackle the problem. $usersWithOrders = $users->find("orders.count>0"); $orders = $pages->find("template=order"); $byUser = array(); foreach($usersWithOrders as $u){ $byUser[$u->id] = $orders->find("id=$u->orders"); }
    1 point
  25. One of those hidden beauties that would be great to have them in the Cheat Sheet...
    1 point
  26. You need to create a file /site/modules/InputfieldCKEditor/contents.css with the styles you want to apply inside the Editor. And have a look at /site/modules/InputfieldCKEditor/README.txt on how to activate it: contents.css ============ Example CSS file for the admin editor. To make CKEditor use this file, go to your CKEditor field settings and specify /site/modules/InputfieldCKEditor/contents.css as the regular mode Contents CSS file.
    1 point
  27. You certainly need to keep mysql connections and mysql queries apart. The first one is causing your db to crash, whereas the latter ones are using these connections. If 30 visitors are causing 400 (I'd expect concurrent) connections I'd check if mysql connections are properly closed.
    1 point
  28. What are you displaying on this site where you get this count? Any field that is not configured as "autoload" will require one select query per page where you access the field. So if you have 20 fields on a template and you're displaying each field for 100 pages in a loop, this would produce about 100*20 = 2000 queries.
    1 point
  29. Maybe I found a solution can be useful to others. When a user register I have a field with an auth code so the user must check his email and click on a link to verify the account. I can recycle this field and after the verification process I can simply set as "firstlogintogo" or whatever I can check after login and clear after the first login.
    1 point
  30. Happy to announce that Media Manager (Beta 001) is ready for release! I had to change the view/edit modes to streamline these into one unified interface. I think it works better as can be seen in the video below (or if can't access YT, see this instead). I am working on the documentation this week and 'preparing shelves at the shop' with an aim to officially release the module next week or early the week after at the latest. If you can't wait that long and would like to get your hands on a copy soonest, please send me a PM. I am also finalising a pricing model. Initially, support will be via email. Thanks for your patience
    1 point
  31. Sorry for not replying. I was too busy, not only with updating this module. There's now a new dev version that fixes issues and improves some things. https://github.com/somatonic/Multisite/tree/dev For example the biggest change is that the configuration is now set in the config.php via an array in $config->MultisiteDomains $config->MultisiteDomains = array( "dev.domain.com" => array( // domain name can be used to map to root page "root" => "www.domain.com", // page name for the root page "http404" => 27 ), "dev.domain2.com" => array( "root" => "www.domain2.com", "http404" => 5332 ), ); This allows for different domain configurations on a dev and live stage, and since it's not in DB (via the module config) it can be easily transfered with a dump without worrying to overwrite or change the settings. Also there's no need to change the domain "root" pages name, as it's not directly coupled to the requesting domain. So you only change the array keys (=domain). Since the whole concept is all a pretty hack, I found that it comes with some complications that can't be solved in a elegant way. So for example the biggest issue is that you can't crosslink pages via the RTE Link plugin, since it doesn't know about Muiltisite. So you'll end with wrong URL's when for example link from a page of one site to a page of another site. If that's an issue it's still possible to copy the ProcessPageEditLink.module and modify the root parent for the page tree select. I'd be glad to help out with an example there. Further, the structure of a multisite install needs to be - Web (PW root page, I call it always "Web" since it isn't the homepage anymore) - www.domain.com (primary site home) - 404 Page - www.domain2.com (a second site home) - 404 Page ... I think I heard people were using a different structure in the current old version like: - Homepage (main site home) - About - Projects - 404 Page - www.domain2.com (second site home) - 404 Page - www.domain3.com (a third site home) - 404 Page ... But this wasn't ever recommended and it can lead to complications. ---- Again since this module is pretty much a hack, I'm not officially supporting and releasing this module. Use at your own risk. We use it in various projects now and while it works fine with all it's little drawbacks, the new version is little more solid. I would rather like to see if there's a way for a more integrated and supported way in the core. But not even sure how this could work out. Ryan may has some ideas or maybe thinks this isn't something PW could support. - Note that there's multisite core support, but it's for different DB's and "site" folders, but that's a different case altogether. Take care Soma
    1 point
  32. Any chance this can be used instead of this page: http://processwire.com/apigen/ I guess the best case scenario would be if Kongondo would be willing to maintain it there? Or maybe that URL can be an alias that points to this version?
    1 point
  33. Great module. Feature suggestion: Would be great if the option to load the dialog could be done via a button on the CKEditor toolbar rather than having to right click to present the context menu. I feel it's too hidden that way.
    1 point
  34. Or you can use wireRenderFile a new addition to ProcessWires functions: https://processwire.com/blog/posts/processwire-2.5.2/#new-wirerenderfile-and-wireincludefile-functions echo wireRenderFile('markup/contact-markup.php', array( 'name'=>'john doe', 'address'=>'sample street', 'zip'=>'sample city' )); I did not test this example, but according to the docs it should work like this. Requires ProcessWire 2.5.2
    1 point
  35. hi totoff, using the TemplateFile class is perfect for this, have a look at ryans blog profile: https://github.com/ryancramerdesign/BlogProfile/blob/master/templates/archives.php#L101 simple way: file "site/templates/markup/contact-markup.php" (naming it -markup here to point out the difference to the standard template file) John Doe<br> Sample Street 1<br> Sample City template file eg "site/templates/contact.php $contact = new TemplateFile(wire('config')->paths->templates . 'markup/contact-markup.php'); echo $contact->render(); // don't forget to echo! more flexible: with variables! markup/contact-markup.php <?= $name ?><br> <?= $address ?><br> <?= $city ?> contact.php $contact = new TemplateFile(wire('config')->paths->templates . 'markup/contact-markup.php'); $contact->set('name', 'john doe'); $contact->set('address', 'sample street'); $contact->set('zip', 'sample city'); echo $contact->render(); edit: in your case you can do $sidebar = $contact->render() instead of echoing it... forgot the point of delayed output
    1 point
×
×
  • Create New...