Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/19/2016 in all areas

  1. @benbyf: I have used to look into the fields exporter to find out some things and found it very quick and nice method. I created a few fields with all settings I'm interested in, select it in the exporter and looked to the json data: So, this alone is not enough, but after seeing a compact list of possible properties I can pickup one of interest and run a search for that in the inputfield class in my editor. <kidding>Don't wail about uncomplete docs or missing tuts. Instead search, find and learn, - we are waiting for you to contribute new tuts!</kidding>
    3 points
  2. $event->object->filename should work I guess.
    3 points
  3. Buchhandlung Scheuermann Today we have relaunched the site of a local bookstore, Buchhandlung Scheuermann. The site is based upon PW 2.7 and twitters bootstrap 3. It is fully customizable for the customer because we made use of: PageTables ALIF Croppable Images And the admin's sweeties are: Admin Custom Files Pageimage Manipulator 2 Pia - Pageimage Assistant ProCache Spex Wire Mail SMTP
    3 points
  4. http://webdesign.tutsplus.com/tutorials/a-beginners-introduction-to-writing-modules-in-processwire--cms-26862 Based on work from here:
    3 points
  5. 2 points
  6. This is genius, thanks @horst. Also thanks for all the tuts jokes... I never thought of myself as a backend guy so hope they're up to scratch and I always comments. @kongondo this is great http://kongondo.github.io/ProcessWireAPIGen/dev/class-Field.html thanks.
    2 points
  7. Unfortunately there's not enough docs at the moment. Isn't that why you are writing docs? . Joking aside... 3 Tips Due to the paucity in documentation most (all?) of us learned by looking at other modules. Simpler core modules, custom modules such as Batcher, Trashman, etc. The module Blog creates fields on the fly during installation. Have a look at the code here. Also have a look at ProcessBlog phpMyAdmin: have a look at the table fields. You will see a list of all the installed fields. Look at the column 'data'. All field settings are stored in there as JSON as key=>value pairs. Why is this important you ask? All (?) the keys in the strings correspond to the field properties that can be set...e.g. $field->description, $field->derefAsPage, etc. Also have a look at the column 'label'. The trick here is to open a field for editing and add and remove settings and save while keeping an eye of the field's 'data' column to observe changes. In respect of templates, same trick can be used on the table 'templates' http://kongondo.github.io/ProcessWireAPIGen/dev/class-Field.html
    2 points
  8. Without visible control it would be less beneficial. What I can imagine is a 3-state control (or more) which changes the bg globally. It could be a small circle which loops through the bg colors on click.
    2 points
  9. @Can: Thanks, I'll take a closer look at this ASAP.
    2 points
  10. A collection of links and information for front-end development. Front-end forms Create simple forms using the API https://processwire.com/talk/topic/2089-create-simple-forms-using-api/ Gist code for the above link https://gist.github.com/somatonic/4027908 Build and process generic forms from page templates https://gist.github.com/somatonic/5011926 Build and process forms manually with the API https://gist.github.com/somatonic/4027908 Upload images https://gist.github.com/somatonic/4150974 Form with fields rendered in a table https://gist.github.com/somatonic/5415646 Manual form markup with file upload handling https://gist.github.com/somatonic/5233338 Form Builder (module) Building front-end forms on your website has never been so simple. ProcessWire Form Builder lets you create, edit and publish forms with no development necessary. http://modules.processwire.com/modules/form-builder/ Front-end member management FrontendUser: login, logout and register users / members (module) https://processwire.com/talk/topic/9811-frontenduser-login-logout-and-register-users-members/ Member login, logout, password reset https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/?p=15919 Popular front-end UI frameworks UIkit http://getuikit.com/ Semantic UI http://semantic-ui.com/ Foundation http://foundation.zurb.com/ Bootstrap https://getbootstrap.com/ Materialize http://materializecss.com/ Skeleton http://getskeleton.com/
    2 points
  11. Did a quick intercoolerJS test... I love it First test: Main layout / template <!doctype html> <html lang="de"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script> <script src="https://intercoolerreleases-leaddynocom.netdna-ssl.com/intercooler-0.9.7.min.js"></script> <title>IntercoolerJS Processwire</title> </head> <body ic-get-from="<?=$page->url?>" ic-trigger-on="load" ic-push-url=true></body><!-- async intercoolerjs call --> </html> A simple autoload module output this main template (PW class TemplateFile is used) above and stops PW execution with php "exit". After initial page load you see an empty page body, but after page loaded the intercoolerjs ajax call will be triggered and load the current page ("$page->url") content. The test was successful and at the moment I write a small module to handle initial (sync) page load (add layout / base template) -> hookAfter Page::render ajax updates with history support -> PW template file just return the current page content sub template support (PW TemplateFile) add / handle css / js (maybe async add / replace css / js with jquery...)
    1 point
  12. Different background on hover makes sense to me, even if it won't play nicely together with touch events. I would keep the checkerboard pattern mainly because otherwise there's slightly bigger chance of the image disappearing into the background completely.
    1 point
  13. @Can: The issue you mentioned should be fixed in the latest version of LinkCrawler.php, though please let me know if it still persists. The problem was that LinkCrawler didn't have access to $wire from the global scope, but since PROCESSWIRE was already defined, it wasn't attempting to instantiate ProcessWire either. I'm no longer entirely sure that current behaviour makes sense in this case (perhaps I should rather allow the user to pass an instance of ProcessWire to LinkCrawler when instantiating it) but at least this seems to fix the issue at hand
    1 point
  14. Maybe there is solution to have some help without any visual overhead. Like having darker/different background on mouse hover (I know that wouldn't work on touch devices)?
    1 point
  15. Finding it quite fustrating work with fields from a module, I cant seem to find any good docs or forum threads. For example I'm making a new field on install of my module, but ideally I would like to know how to set flags, default value, max- min etc for that field but it's not obvious to me. All I can mange so far. $f = new Field(); // get a field type $f->type = $this->modules->get("FieldtypeInteger"); $f->name = $this->fieldName; $f->label = 'Publish Page later'; $f->save(); // save the field I'm finding this elsewhere with integrating with the admin, but not at all with the API itself which has great documentation. Any advice, guidance would be great!
    1 point
  16. Weirdest thing: was about to post literally the same percentage as Antti this morning, based on my own experience. I've stumbled upon similar need *once* among all the sites I've worked with so far. If I'm anywhere close to a "typical user", having a visible toggle for this would be just redundant cognitive load to majority of users out there (not to mention unnecessary technical debt for the system) and thus I would vote against it. Always ready to rethink my opinion if others have very different experiences. Who knows, I might be in the minority here
    1 point
  17. Visible bg color control is something that over 99% (my estimate) of image fields do not require. It would be poor ui design to have it always visible. That is very edge case scenario you are solving (white transparent images) so it shouldn't cause any overhead to other use cases (or even code) that image fields are used for.
    1 point
  18. The easiest way to find those properties is to enable debug mode and hovering over the "collapse" icon of those options, when editing the field. This will often show you how those properties are named. Also the php docblocks of those modules are geting better and better in stateing those as well. Use them just like that: $this->min = 1.
    1 point
  19. These are the default settings of Photoshop (dark, medium, light): Text color is intentional, but you never know what you'll come across. If we cannot change it on the fly, then can it really be that useful?
    1 point
  20. Thanks, v034 should fix this. The default admin theme is a bit of a stepbrother because I don't use it so such bugs may come up more frequently there. I also got rid of a z-index renumbering issue coming from sass but this doesn't mean there will be no more z-index issues There are some other CSS fixes regarding the layout for the default theme, hopefully I haven't broke anyting. The loader animation should be vertically centered too.
    1 point
  21. You could also make use of this module: http://modules.processwire.com/modules/process-redirect-ids/
    1 point
  22. One more addition. Background switcher should also appear on image select popup window.
    1 point
  23. Caddy 0.9 released with rewritten core
    1 point
  24. @regesh How about using Pages::saved ? http://processwire.com/api/hooks/#before_or_after an example of using the hook:
    1 point
  25. Hi, Can you show us the family tab of your template?? Gideon
    1 point
  26. Agree with you. I think that also it would be nice to be able to set default background in field setttings.
    1 point
  27. I made a new color style for the default theme PW 3.0.25. I just copied the default theme's folder to site/modules, changed Default to DefaultExtra so it doesn't conflict with the default one and added an extra css file.To install unzip archive to site/modules, go to modules page, hit refresh, install theme, choose style (Clear Sky), go to profile and activate DefaultExtra. AdminThemeDefaultExtra.zip
    1 point
  28. Hello, guys! I've prepared an extract of my latest work for public usage: Template for ProcessWire with Stylus and PostCSS. It simplifies the development of the stylesheet and JS files with CSS preprocessors, autoprefixes and browser reloading. I hope it can be a good kickstart for your next project! https://github.com/leonidlezner/pwtemplate Released under MIT, no credits or copyright notices are necessary, so feel free to do with it whatever you want Update: Template works with 3.x too! And now with German Tutorial http://leogo.es/qvxul
    1 point
  29. It is a caching problem. You have copied cache values (directory pathes) from one computer (your online) to another computer (your local), and file_last_modified timestamps too. But this stored ones from your online mostly will not match to your locals. So you need to clear caches and have to refresh the modules lists. (Maybe better 2 times than only once ) After all the caches are refreshed and the filecompiler builds all fitting to your local computer, all settings in DB should work again. The second thing in your case is the SessionHandlerDB. SessionHandlerDB is an alternative handler fro session management. Now, after you have disabled it the hard way, PW switched to the default session management via files, located under site/assets/sessions/. If you like, you also can switch back to SessionHandlerDB after all other caches (also minor one!) are working perfect again. To switch back, please go to modules and install it via the interface, as you have done when using the first time. (Don't modify the modules table!! this only works the other way round!) ------ --- ------ To avoid those caching issues, you could use the SiteExporterModule, but this would not give you an exact copy of your online site. So, in your case you have done most things right. Only thing what you may try next time could be: make a copy of all site/... files to your local PC modify the site/config.php to point to your local DB get a mysql dump from your online DB modify the mysql dump: remove all entries of the tables "caches, sessions", but only the data value entries, not the table definitions! import the modified mysql dump into your local DB login into admin, go to modules and hit the refresh button one or two times
    1 point
  30. I just updated the module to support also href='mailto
    1 point
  31. Hey.... I figured it out. It was an echo statement messing up the buffer, in turn causing the Ajax call in ProcessPageList.js to fail. Just shoot me. Apologies to anyone who spent time looking at the post. And I just advanced to junior member too lol Have a good one..
    1 point
  32. Wow ok, thanks for the encouraging comments guys I've worked with PW for quite a while, surfing the core silently in the background (I'm a little shy like that). But one day apeisa gave me a proper kick in the knee and told me to grow a pair - I did, ergo, here I am. I must say you have a really good thing going on here and I'm very happy to be part of it!
    1 point
  33. Greetings, What makes ProcessWire so excellent is the ability to do all kinds of work at the API level, so that you can essentially create a custom admin for your projects. Editing a page is of course a crucial part of any custom admin. NOTES: Of course, you must cutomize this to your project. Also, in my code I am editing the page directly inside the page itself. In other words, you display a page as usual, but inside it you have your edit code, as well as code to save the page after editing. The other option would be to link to another page just for editing. Editing does get rather involved. Below is a technique I've used. I'll break editing down to several steps, then later I'll put it all together as one. Here goes... Step 1: Isolate Who Has Editing Rights You don't want anyone who can view the page editing it! I use code like this to limit editing to people with either an "editor" or "superuser" role. We open it here, and close it later in Step 6: <?php if ($user->isSuperuser() OR $user->hasRole("editor")) { Step 2: Set the $page Variables (Except Title) to Hold Edited Values Take inputs received from a submitted form and use those values to replace current $page values. For this example, I am only using two fields to keep it simple. And they are text fields. We hold off on setting the title, since that needs special handling: <?php if ($input->post->title) { $page->set("first_name", $sanitizer->text($input->post->first_name)); $page->set("last_name", $sanitizer->text($input->post->last_name)); } Step 3: Edit Title Field, but Only if the Title is Unique, Then Save the Page You need something like this so you don't get an error if the title you apply to the edited page collides with the title of an existing page. The code below confirms that the title is unique and allows you to set the title, and only then save the page: $thistitle = $page->title; $matchedtitle = $input->post->title; $checktitles = $pages->find("parent=/[path]/[to]/[parent]/, title=$matchedtitle|$thistitle"); $titlecount = count($checktitles); if($titlecount < 2) { $page->of(false); $page->set("title", $sanitizer->text($input->post->title)); $page->set("name", $sanitizer->text($input->post->title)); $page->save(); Step 4: Refresh URL Think about it... If while editing this page we changed the title, the URL you are on is no longer valid. Here's a simple bit of Javascript to handle this. The code below also closes out the conditional set in Step 3: $refresh=$page->url; ?> <script type="text/javascript"> window.location = '<?php echo $refresh ?>'; </script> <?php } Step 5: Handle the Scenario When the Page Title Collides In Step 3, we edited the page title because it passed the "unique" test. But what if it fails that test? We would move to this section of code, where a message lets the user know there is a problem. A bit of Javascript helps make the warning fade in so it is more noticeable: else { ?> <div class="admin_error_box"> <p>Sorry, there is already a page using this title: <?php echo $input->post->title?>!</p> <p>Please enter a different title in the form.</p> </div> <script> $(function() { $('.admin_error_box').hide().fadeIn(3000); }); </script> <?php } Step 6: The Edit Form We need a form to capture the submission of edits. It would look the same as your page-creation form, but would have to be pre-populated with the current values of the page, which will also change upon submission of the form. The last bit of code closes out the check on user roles set in Step 1: <div class="page_create_form_box"> <p class="form_heading">EDIT THIS PAGE USING THE FORM BELOW</p> <form action="<?php echo $page->url ?>" method="post"> <ul> <li><label class="label_class" for="title">Page Title:</label> <input type="text" class="input_class" name="title" value="<?php echo $page->title ?>"></li> <li><label class="label_class" for="first_name">First Name:</label> <input type="text" class="input_class" name="first_name" value="<?php echo $page->first_name ?>"></li> <li><label class="label_class" for="last_name">Last Name:</label> <input type="text" class="input_class" name="last_name" value="<?php echo $page->last_name ?>"></li> </ul> <button class="admin_submit" type="submit" name="submit">SAVE EDITED PAGE</button> </form> <?php } ?> Step 7: Putting it all Together Now let's put all of this code into one continuous routine. <?php if ($user->isSuperuser() OR $user->hasRole("editor")) { ?> <?php if ($input->post->title) { $page->set("first_name", $sanitizer->text($input->post->first_name)); $page->set("last_name", $sanitizer->text($input->post->last_name)); } $thistitle = $page->title; $matchedtitle = $input->post->title; $checktitles = $pages->find("parent=/[path]/[to]/[parent]/, title=$matchedtitle|$thistitle"); $titlecount = count($checktitles); if($titlecount < 2) { $page->of(false); $page->set("title", $sanitizer->text($input->post->title)); $page->set("name", $sanitizer->text($input->post->title)); $page->save(); $refresh=$page->url; ?> <script type="text/javascript"> window.location = '<?php echo $refresh ?>'; </script> <?php } else { ?> <div class="admin_error_box"> <p>Sorry, there is already a page using this title: <?php echo $input->post->title?>!</p> <p>Please enter a different title in the form.</p> </div> <script> $(function() { $('.admin_error_box').hide().fadeIn(3000); }); </script> <?php } ?> <div class="page_create_form_box"> <p class="form_heading">EDIT THIS PAGE USING THE FORM BELOW</p> <form action="<?php echo $page->url ?>" method="post"> <ul> <li><label class="label_class" for="title">Page Title:</label> <input type="text" class="input_class" name="title" value="<?php echo $page->title ?>"></li> <li><label class="label_class" for="first_name">First Name:</label> <input type="text" class="input_class" name="first_name" value="<?php echo $page->first_name ?>"></li> <li><label class="label_class" for="last_name">Last Name:</label> <input type="text" class="input_class" name="last_name" value="<?php echo $page->last_name ?>"></li> </ul> <button class="admin_submit" type="submit" name="submit">SAVE EDITED PAGE</button> </form> <?php } ?> My apologies for any problems with the formatting of the code above (please use your editor to assure proper tabs). Notes: - If you include checkboxes or other field types in your page, the editing is a bit more involved. - If you have image fields, you would have separate actions connected with those. For more information on handling image fields in custom forms, take a look at this: http://processwire.com/talk/topic/3105-create-pages-with-file-upload-field-via-api/ That should get you started! Follow up if you have more questions! Thanks, Matthew
    1 point
×
×
  • Create New...