Jump to content

Leaderboard

Popular Content

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

  1. Tracy Debugger for ProcessWire The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS Integrates and extends Nette's Tracy debugging tool and adds 35+ custom tools designed for effective ProcessWire debugging and lightning fast development The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger Modules Directory: http://modules.processwire.com/modules/tracy-debugger/ Github: https://github.com/adrianbj/TracyDebugger A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.
    21 points
  2. Thanks everyone for the great interest in this module! I have just added 2 new sections to the PW panel that shows details of all fields on the current page. I would love to hear from you if you have any ideas for other sections/info that you would find useful to have in the PW panel. List View Shows basic details with the name linked to the edit page for that field: Object View Shows the fields object - for details of each field, expand the "data" section:
    4 points
  3. You could also add a custom api variable like that. $this->wire('variableName', $obj); In your case it's both config, but if you're adding something different this might even be more appropriate.
    4 points
  4. This week we've got a really nice improvement to ProcessWire's page tree, something that I believe everyone that uses the ProcessWire admin will appreciate. Also a big focus this week was on ProDrafts and wrapping that up so that we can release it and make it available to you. More on both here: https://processwire.com/blog/posts/processwire-3.0.8-brings-smarter-faster-page-tree/
    3 points
  5. Hello to all of you. I am very happy to see that this thread has been revived recently. I am a new in the community. Using and learning PW for about 6 month now. It's has been a real pleasure and completly in love with this product.... however I fell the UX of the admin is a point that would require a bit of improvement. It would make the life of the admins a bit smother and We all now that it is through this interface that new user get in touch with PW and they form there first impressions partly on it... With the great idears given by Ryan ragarding growing PW in 2016 I guess a sligthly modernized design and improved UX would be a real asset. At the same time we should stick to the great philosophy of this admin UI whis is simplicity. When I started using PW. I kept telling my self : this page tree is such a great idea why the hell doesn't it fell pleasing to use... As mentionned on other posts, I guess it should follow some more common paterns of page trees. I also did click manytime on the name of the page or try to drag and drop many times without understanding how it worked (finaly I was saved by a post on the forum...from a UX point of view thats not too good).I found the page tree of Modx very nice to use (left click on the name of the page to open the page the edit screen and the rigth click on the page name to access the menu items, felt natural to me). Second a page tree always visible + that stays open where it was (as introduced this week in PW 3 ))is a must for me (may be with a toogle for those who dont want it alwas visible). It would simply make every thing more fluid. So thanks Tom for this concept it is quite good. I like the idea to be able so switch easily from page tree to lister (although you can already do that with lister pro and add the short cuts in the pages menu) My 2 cents : overall I have a concern with screen real estate. Specialy if you use that theme on laptop screen. I fell that puting the admin menu on the left panel is a waste of screen real estate (this why I tend to prefer default admin to the Reno theme). I (personanly) prefer it like in the default admin (horizontal menu bar at the top). Like this the menus drop down just when you hover your mouse I find that super easy and fast. and putting the items of the pages menu in a second colum (instead of putting it in a drop down below the pages menu in the first colum, like in the Reno theme) also taking a lot of width. One question : how does it work when you click on a lister shortcut. is the page tree replaced by the list and the page edit screen stays as they are (that would be great) Thanks
    3 points
  6. Actually I am, and have been for 18 years now, but that is a very different kind of love
    2 points
  7. Looks like you're really in love with Tracy
    2 points
  8. Nice to see the ideas here. There are a variety of needs and use cases for the admin, which is why it's nice to have an admin that can be customized so easily. We use both Reno and the default where I work, just depends on what the admin needs to do. The sidebar navigation is extremely useful for many of our projects, but there are times where the default admin is better suited. Some people think cucumbers taste better pickled.
    2 points
  9. Sorry, this is just too much fun Just added a Current Page Info section, with links to edit the page (from the name), edit the template, and open the page tree with this page expanded to show the children (from the number of children).
    2 points
  10. In the past I have struggled a lot with right clicking in MODX. I really didn't know you could right click. Most documentation didn't even tell you could right click, so I really didn't understand where to find the settings they mention. About the left nav. These days most of our projects do not need a front-end at all. Most of those sites are about managing data. We really need the horizontal space. 20+ fields on a row in ListerPro is not something unusual here.
    2 points
  11. I often use jsdelivr as free javascript CDN. They also offer the files for this slider on their CDN at https://www.jsdelivr.com/projects/flickity Only for those who are interested in. Advantage: you can combine multiple js files from this CDN into one - so only one request will be made Best regards
    2 points
  12. Good stuff! I was hoping to see a more feminine screenshot too
    2 points
  13. Thanks for implementing my feature suggestions just a week after I posted about it. This will certainly make working with the page tree much more friendly especially to beginners/editors.
    2 points
  14. Really looking forward to ProDrafts, and the page tree enhancements are fantastic!
    2 points
  15. in my config.php, i setup an empty array for siteSettings like this: $config->siteSettings = array(); then in my ready.php file i'm array merging some values from a settings table (profields table), in the admin like this: $st = $pages->get('/settings/')->settings_table; $settings = array(); foreach($st as $row) { if(!$row->value) continue; if($row->disable == 1) continue; $settings[$row->setting] = $row->value; } $config->siteSettings = array_merge($config->siteSettings, $settings); i'm curious if anyone sees any possible issues with this; it works now and i can access my siteSettings everywhere doing this;
    1 point
  16. Wire Queue Wire Queue is a module that allows easy creation and usage of Queues in ProcessWire. It is based upon a basic parent module (WireQueue) that should have one or multiple StorageHandler modules installed too. This beta release contains a simple plain text storage module, WireQueueTextfile, and a simple Sqlite3-DB storage module, WireQueueSqlite3. The base module creates the needed: FIELDS (wire_queue_type, wire_queue_state, wire_queue_storage_options) TEMPLATES (wire-queue-container, wire-queue-storage, wire-queue-tools) PAGES (wire-queues = container for all Queuepages, wire-queue-storages = container for StoragetypePages) ROLE (wire-queue-admin) Each storage module creates one page under wire-queue-storages. New Queues can be created in the backend by adding a new page under "Wire Queues". After creation one have to select a Storage type from availables list and publish the page. After that, there are some buttons available to start / pause / and close the queue. Putting and getting data to and from the queue is done via API calls. First you have to get the page that holds the queue object. // get and validate the queue handle if($queue = $pages->get(SELECTOR_TO_DESIRED_PAGE)->wireQueue()) { // wrap your data into an array and pass it into the queue $success = $queue->addItem($data); ... } // get and validate the queue handle if($queue = $pages->get(SELECTOR_TO_DESIRED_PAGE)->wireQueue()) { $data = $queue->getItem(); ... } Thats basically all what you want from a queue. Following are a few conveniences: $queue->getPage()->title gives you the title of the queue, ($queue->getPage() returns the page object) $queue->className() shows the StorageType of the queue $queue->getState() and $queue->getStateStr() returns the current state of a queue: 1 = new / empty 2 = enabled / running 3 = paused 4 = closed / archived $queue->itemCount() gives the total number of all pending items in the queue Here is code that gives an overview of all Queues in the system: $container = $pages->get('template=wire-queue-container'); $bodyContent = "<h1>$container->title</h1>"; $bodyContent .= "<p>There are currently {$container->numChildren} Queues defined:</p>"; $bodyContent .= "<ul>"; foreach($container->children() as $p) { if(! ($queue = $p->wireQueue())) continue; $bodyContent .= "<li>{$queue->getPage()->title}<ul>"; if(!$queue->ready2use()) { $bodyContent .= "<li>{$queue->className}</li>"; $bodyContent .= "<li>This Storagetype is not ready to use! The System seems not to provide all requirements.</li>"; $bodyContent .= "</ul></li>"; continue; } $bodyContent .= "<li>{$queue->className}</li>"; $bodyContent .= "<li>{$queue->getStateStr()} ({$queue->getState()})</li>"; $bodyContent .= "<li>Currently are {$queue->itemCount()} items pending!</li>"; $bodyContent .= "</ul></li>"; } $bodyContent .= "</ul>"; Following is a screenshot of the backend The module is available in the modules directory: http://modules.processwire.com/modules/wire-queue/ Or you get it from Github: https://github.com/horst-n/WireQueue. . . . The Sqlite3 storage handler not only let you push and pull data items to and from it, it also can keep track of the current state of a record. If you use multiple / different workers for pulling and processing the data, you can store an ID for them too. This is how the DB Table looks like: The Wire Queue Sqlite3 storage handler provides the methods addItem($arrayData) // same as WireQueueTextfile getItem($worker = null) // same as WireQueueTextfile, (but the textfile storage cannot support $worker!) updateItemState($id, $state, $worker = null) // this you can use for further processing, if you want . addItem($arrayData) $arrayData is a, maybe associative, array containing all your data for one record. The method stores it under the next free id under data in the Sqlite-DB-file and sets the state to 0. The field worker is empty for new added records. Following is a basic working example for pushing data records into a queue: // you have created a queue in PW, the ID of the page is 1420 for example // here is some skeleton code for an importer that uses this queue // get and validate the queue handle if(! ($queue = $pages->get('id=1420')->wireQueue())) exit(); // we could not get the Queuepage // now start to scan / read data for your imports, wrap each record into an array and put it into the queue foreach($pages->find(YOURSELECTOR) as $p) { $data = array($p->field1, $p->field2); $queue->addItem($data); } . . getItem($worker = null) $worker is an integer that you can define to suite your needs. If you don't use or don't want identify multiple workers, just ommit it. The method pulls one pending record from the queue, changes the state from 0 to 1, and returns an associative array with the keys id and data. array('id' => integer, 'data' => array) You will need the id if you further want to use the queue to keep track of processing steps. You must pull your stored $data from $array['data'] and use the id for further storing the state. . updateItemState($id, $state, $worker = null) $id identifys the record a worker has processed, for $state you can define and use every integer you like, but not 0 or 1. If you also want to store altered data, and not only different states, you can use updateItem($id, $state, $worker = null, $data = null) instead of updateItemState(). . Here is a working example with a bit pseudo code how workers can get a pending record to process it further and store back the result of the process: // you have created a queue in PW, the ID of the page is 1420 for example // here is some skeleton code for an importer that uses this queue // get and validate the queue handle if(! ($queue = $pages->get('id=1420')->wireQueue())) exit(); // we could not get the Queuepage // we do not use different workers here in that example, so we do not pass an worker id here $tmp = $queue->getItem(); // get a record from the queue $record_id = $tmp['id']; // store the record id $data = $tmp['data']; // get the data array // process the $data ... // and get the result of the process, in this example true or false $result = processMyRecord($data); // as new records have a state = 0, fetched records have a state = 1, // you may define a state of 2 for successful processed records, and higher ones for failed records $state = true === $result ? 2 : 3; $queue->updateItemState($record_id, $state); . . getItem4FurtherProcessing($state, $worker = null) The $state you pass to the method is the state you want get the record for. If there is one pending, its state will be set +1 and the id and data is passed back to you in an associative array: array('id' => integer, 'data' => array). --------- Here is a pseudo code example how (multiple) worker scripts may batch process queue records with the sqlite storage handler // on the server in this example, everyscript will timeout / die after 180 seconds // we start a timer $time = Debug::timer(); // we use different instances of workers that pull and process records from the queue, // so additionally to the processings states, we also want to store the worker ids $worker = 2000; // now start to process items by pulling one after the other from the queue while(150 > Debug::timer($time)) { $tmp = $queue->getItem($worker); // get a record from the queue if(!$tmp) continue; // maybe currently are no pending records available $record_id = $tmp['id']; // store the record id $data = $tmp['data']; // get the data array $result = processMyRecord($data); // process the data and get back the result $state = true === $result ? 2 : 3; // define an integer for the new state, according to the result of processing the data $queue->updateItemState($record_id, $state, $worker); } // we are close to the timeout for the script, so finish it with calling it itself to get a fresh run $session->redirect('./');
    1 point
  17. You could try Tracy Debugger: https://processwire.com/talk/topic/12208-tracy-debugger/ Install, set mode to "DEVELOPMENT" and see the bottom-right corner of the window for any error.
    1 point
  18. This should do it - just change "body" to the name of the existing field that you want to insert before. You can of course change insertBefore to insertAfter if that is easier/needed. if($page->template == 'service-type') { $f = new Field(); $f->type = $this->modules->get("FieldtypeRangeSlider"); $f->name = 'servicetype_' . $page->name; $f->label = 'Service-Type ' . $page->get('title')->getDefaultValue(); $f->set('suffix','%'); $f->set('tags','servicetype'); $f->set('icon','fa-sliders'); $f->save(); $existingField = $page->template->fieldgroup->fields->get("body"); $template = $page->template; $template->fieldgroup->insertBefore($f, $existingField); $template->fieldgroup->save(); } Here's a relevant section from the core ProcessField module that shows this in action: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Process/ProcessField/ProcessField.module#L1850
    1 point
  19. There are handy Grunt and Gulp tools, e.g. http://mattsoria.com/killersvgworkflow/ For a site that used tons of icons (including :hover versions), we used Grunt tasks that: - scanned a folder full of SVGs - created an SVG sprite - wrote a .scss file with classes for each icon (based on some simple naming conventions) - plus: did the same thing, but as PNGs (IE9 / old browser fallback) I wouldn't use SVGs in HTML emails though. There are still various email clients (web-based, standalone desktop or mobile apps) that don't support it. https://css-tricks.com/a-guide-on-svg-support-in-email/
    1 point
  20. Thanks to a bug report from horst I just committed a new version that fixes a Windows directory path issue. He also pointed me to another problem which is turns out means that this module currently only works with the 3.x branch of PW. I will look into supporting 2.x, but for the moment if you want to test, you will need 3.x or you can probably make it work on 2.7 if you uncheck "Show ProcessWire Panel" in the config settings. You'll miss out on that functionality, but hopefully everything else should work.
    1 point
  21. I have had a read about the way(s) one can embed it into CSS, where base64-encoded was title as sub-optimal as SVG is textbased (XML) and not binary data. They suggested this way: background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' width='120px' height='120px' viewBox='0 0 379 379'%3E %3Cg transform='matrix(1.25,0,0,-1.25,40,345)' id='g10'%3E %3Cg transform='scale(0.08,0.08)' id='g12'%3E %3Cpath id='path14' style='fill%3Argb(0,0,0)' d='m 1517.6,1767.02 c 138.62,0 251.01,-112.38 251.01,-251.02 0,-138.62 -112.39,-251.01 -251.01,-251.01 -138.64,0 -251.02,112.39 -251.02,251.01 0,138.64 112.38,251.02 251.02,251.02 z m -1.59,1264.99 C 679.137,3032.01 0.644531,2353.89 0.015625,1517.16 L 0,1517.16 0,749.051 388.961,403.559 l 0,1127.031 c 0,622.48 504.602,1127.06 1127.049,1127.06 622.45,0 1127.03,-504.58 1127.03,-1127.06 0,-622.41 -504.58,-1127.031 -1127.03,-1127.031 l -206.22,0 0,552.769 206.22,0 c 317.15,0 574.32,257.102 574.32,574.262 0,317.2 -257.17,574.32 -574.32,574.32 -317.16,0 -574.291,-257.12 -574.291,-574.32 L 941.719,0 1516.01,0 c 837.26,0 1516.01,678.73 1516.01,1515.99 0,837.28 -678.75,1516.02 -1516.01,1516.02' /%3E %3C/g%3E %3C/g%3E %3C/svg%3E") --- If you like and are brave, just drop the data uri into your browsers URL bar and press enter: data:image/svg+xml;utf8,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' width='120px' height='120px' viewBox='0 0 379 379'%3E %3Cg transform='matrix(1.25,0,0,-1.25,40,345)' id='g10'%3E %3Cg transform='scale(0.08,0.08)' id='g12'%3E %3Cpath id='path14' style='fill%3Argb(0,0,0)' d='m 1517.6,1767.02 c 138.62,0 251.01,-112.38 251.01,-251.02 0,-138.62 -112.39,-251.01 -251.01,-251.01 -138.64,0 -251.02,112.39 -251.02,251.01 0,138.64 112.38,251.02 251.02,251.02 z m -1.59,1264.99 C 679.137,3032.01 0.644531,2353.89 0.015625,1517.16 L 0,1517.16 0,749.051 388.961,403.559 l 0,1127.031 c 0,622.48 504.602,1127.06 1127.049,1127.06 622.45,0 1127.03,-504.58 1127.03,-1127.06 0,-622.41 -504.58,-1127.031 -1127.03,-1127.031 l -206.22,0 0,552.769 206.22,0 c 317.15,0 574.32,257.102 574.32,574.262 0,317.2 -257.17,574.32 -574.32,574.32 -317.16,0 -574.291,-257.12 -574.291,-574.32 L 941.719,0 1516.01,0 c 837.26,0 1516.01,678.73 1516.01,1515.99 0,837.28 -678.75,1516.02 -1516.01,1516.02' /%3E %3C/g%3E %3C/g%3E %3C/svg%3E
    1 point
  22. yes, i use it as css-property background-image and img tag.
    1 point
  23. We use it in a variety of ways. As inline (base64-encoded) :before / :after content, as bg-images or plain img-tags. For icon-stuff, we switched completely from icon-fonts to SVG a while ago.
    1 point
  24. Generally, I use inline SVG for easy manipulation. My stance is that if a browser doesn't have enough support SVG, then I don't support the browser. That said, I don't use much SVG... Just my 2c.
    1 point
  25. Exactly. You would even get $settings in template context.
    1 point
  26. Many Thanks. This will be a first choice development tool.
    1 point
  27. You did it again adrian, big thanks for this.
    1 point
  28. Page tree improvement also works with Reno theme, thanks!
    1 point
  29. I read this article from WordFence recently. It gives you an idea as to how these attacks are done in detail. Worth a read/watch: https://www.wordfence.com/blog/2016/02/wordpress-security-attack-platform/
    1 point
  30. Greetings Congomonster, This will work! You need to incorporate this plugin (or one like it), into your site's existing code for handling file uploads. So you first build the form to handle file uploads, then add the plugin to target the file-upload field. Take a look at these discussions on file-uploads in ProcessWire forms: https://processwire.com/talk/topic/3105-create-pages-with-file-upload-field-via-api/ https://gist.github.com/somatonic/5236008 Thanks, Matthew
    1 point
  31. I use MultiValue Textformatter for such cases. Mainly for social links, contact data and such. http://modules.processwire.com/modules/textformatter-multi-value/ https://processwire.com/talk/topic/10827-multivalue-textformatter/
    1 point
  32. EDIT 3: Updated the code. Now it doesn't alter the modified time and modified user-id anymore. Before the change, it altered it of each page that changes the sort value! Also now it is lightning fast! instead of 30 seconds it now only uses 2 seconds.
    1 point
  33. Take a look at Soma's gist. It loops through all the fields of your page and displays a form. Then on Submit of the form it again loops through each field and saves the value. It also includes all styles and scripts that you need for your form to work on the frontend. This is working great for my frontend form. If you need help implementing it, let us know.
    1 point
  34. what is the inputfield selctable pages defined with? $field->attr("value", $field->getSelectablePages(new NullPage)); should work?
    1 point
  35. Nice one Reno. I just tested and it works! My quick mash - I am sure it could be improved. $template = $templates->get("your-details"); foreach ($template->fields as $field) { $fieldlabel = $template->fieldgroup->getField($field, true)->label; echo "<label for='$field->name'>".$fieldlabel."</label>"; $inputfield = $field->getInputfield($page); echo $inputfield->render(); }
    1 point
×
×
  • Create New...