Leaderboard
Popular Content
Showing content with the highest reputation on 01/15/2016 in all areas
-
This week we've released ProcessWire version 3.0.5 which actually contains quite a lot of changes. Now you can nest repeater fields (repeaters in repeaters) and use dynamic/AJAX loading for all items. Plus we've got the first test version of Repeater Matrix released, and new support for field templates… https://processwire.com/blog/posts/more-repeaters-repeater-matrix-and-new-field-rendering/4 points
-
------------------------------------------------------------------------------ This is officially released now with some fixes and a second storage handler based on SQLite3. ------------------------------------------------------------------------------ WireQueue WireQueue is a module that allows easy creation and usage of Queues in ProcessWire. It is based upon a basic (parent) module that can or should have one or multiple StorageHandler modules. This alpha pre release contains a basic plain text storage module, WireQueueTextfile. 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 are a screenshots of the backend The module is on Github: https://github.com/horst-n/WireQueue Would be nice if someone has time and can test it a bit and report back.3 points
-
bad weather, lot of time... here you find the german lang pack for PW devns https://github.com/Manfred62/pw-lang-de-devns3 points
-
New in version 3.0 Removes the limitations of the previous releases! Now compatible with all Inputfield types including Select, SelectMultiple, Checkboxes, Radios, AsmSelect, PageListSelect, PageListSelectMultiple, and PageAutocomplete. When using the create new page feature, new pages are added to the field and selected automatically as soon as the modal is closed. No further input is required from the user. The "View" and "+ New" strings are now translatable The add new page links may be enabled independent of the view/edit links Code performance improvements GitHub: https://github.com/thetuningspoon/AdminPageFieldEditLinks Direct Download: https://github.com/thetuningspoon/AdminPageFieldEditLinks/archive/master.zip I ended up using a combination of different methods for populating the field with the new page once it's created. Some of the input types were fairly easy and could be updated without reloading the field, while others required some pretty wild code acrobatics, taking advantage of Ryan's new AJAX reload and repopulating the input with pages that were already selected but not yet saved. Please let me know if you run into any bugs. This was built mainly in Chrome with limited testing outside of it so far, so I expect some issues. I hope you guys enjoy the new features! Let me know if you have other suggestions for further enhancements.3 points
-
This afternoon i was setting up a new laptop with Win7 64bits. Having used it in the past with no problems i decided to use Wampserver 2.5 to setup my webdev environment. Having set up an existing project and a vanilla PW install i noticed that some front-end pages took quite long to respond/render. After logging in i also noticed this in the back-end. Especially opening a template edit page performed bad, with a noticeable 2 to 3 seconds delay in the response. This was not at all the case with the live site running the same code base. After some hair-pulling i discovered that it was xdebug slowing things down. In Wampserver it comes bundled with the following settings in php.ini (to which i added the max_nesting_level because the default 100 will cause problems in PW) : ; XDEBUG Extension zend_extension = "c:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll" ;xdebug xdebug.remote_enable = off xdebug.profiler_enable = off xdebug.profiler_enable_trigger = off xdebug.profiler_output_name = cachegrind.out.%t.%p xdebug.profiler_output_dir = "c:/wamp/tmp" xdebug.show_local_vars=0 xdebug.max_nesting_level = 200 After commenting out all of the above, basically disabling xdebug altogether, my PW installs where back to normal, snappy performance. Because i don't use xdebug for debugging or profiling i'm fine with totally disabling it. This might be a tip for people experiencing bad performance in relation to xdebug. What i do find surprising is that with the above settings no actual debugging/profiling is enabled. The only thing xdebug needs to do is collect info for it's stack trace. Would this really cause such slowdowns?2 points
-
Thnx I'm totally new to ProcessWire and already starting to become a fan Thank you for the introduction to PIA2 points
-
Try $layout = wireRenderFile("products-index-tpl", array('products'=>$childpages));2 points
-
@GuruMeditation, You and everyone on this forum are an important part of this ProcessWire Community. Learning the many things about ProcessWire can be difficult, I know it's taken me a long time. I'm still learning about module development. I would hope that you don't give up or think that your concerns have no merit. The fact that you bring them up, means that we are made aware and I know there are many people on this forum willing to help with anyones understanding. Everyone's level of understanding is different, however I believe you will get there. Things in ProcessWire are changing all the time, unfortunately the documentation doesn't always translate into concepts that novices (me included) can quickly understand. I know I work with things and eventually the lightbulb comes on and I can move on. Finally, ProcessWire is a great tool that can help you do many things. There are many things to learn and I hope that you will continue to ask questions, as we all learn something new when people give freely of their knowledge as they do on this forum.1 point
-
1 point
-
Looks like it might just be for 3.0 "This PW version is also the first to support ProFields Repeater Matrix" https://github.com/ryancramerdesign/ProcessWire/commit/eb8aa2f953154e34924081fcfc0f07bd748ceead1 point
-
Check the MySQL character set of your database or fields and change it from "latin1_swedish_ci" to "utf8_general_ci". But don't do this without backup / testing first1 point
-
Quite surprising to see these comments on a quite old thread, with some talented devs. XDEBUG is also known for throwing max nesting level errors, which will popup sooner than later.1 point
-
I've recently switched to IIS for development. Still a little bit of manual work (once you know what you're doing, you're up-and-running in less than an hour, though) but once it's up, it's really fast.1 point
-
Such ready made packages will probably always be outperformed by a server, which does rarely more than serving webpages, whereas your laptop is running the whole OS and other programms at the same time. You could try using a vm with something like ubuntu and see if it's faster. I've read a few days ago from sass compilation speed up tips and the author did report that a virtual ubuntu was indeed faster than the hosting mac os computer.1 point
-
Wow! Thank you so much. I noticed from time to time that the "backend"/admin area is responding faster on the server as on my local machine. But I had no real idea what causes this. In that time I deactivated Xdebug by disabling some parts in the php.ini. Now I deinstalled Xdebug completely and BÄM™ the "backend" loads much more faster (instead of some seconds to below one second). So it's seems to be a difference between disabling the relevant parts in the php.ini or deinstalling it completely. I found an interesting article discussing this issue.1 point
-
I believe you need to click the "More Reply Options" button, which will bring up the full editor. Then you can add your images.1 point
-
UK https://processwire.com/talk/topic/1829-hosting-for-pw-sites/1 point
-
I have my own blog hosted with vidahost.com. Their shared cloud hosting(?!?) is very affordable - https://www.vidahost.com/cloud-web-hosting/overview and I've had no problems in the first 12 months with them.1 point
-
It is difficult this simply because every time I think I have found the perfect host, they mess up somewhere. However, recently, I have had good service from http://www.kualo.co.uk/ Can't guarantee it will stay that way!1 point
-
For me this is great news. All my sites going forward will only be tested in IE11. If there is a problem with anything below that, the end of life can be highlighted to the client, and a fix will cost extra (unless it is simple of course). Gone are the days I have to spend time and implement fixes for crap browsers for no extra money.1 point
-
1 point
-
Do you have a hint for anybody who wants to automate this visiting task? I have a client with a rather small website that shall not be visited but downloaded by him and I would love to offer a one-click solution to him. If this can be done using ProCache I would love to buy the module for this project. EDIT: I do not know ProCache yet. Is it possible to add a hook on page save that somehow calls ProCache and automatically indexes the page after it has been saved? Thanks!1 point
-
A lot of people think they can code all day long, but do they realise they're debugging most of the time. Welcome to the club...1 point
-
I'd go with a PDF library like mpdf or tcpdf which create your files serverside - they all are similair (depending on the same basic library called fpdf). If you can create your invoice in HTML, you should try the mpdf library, simply because the support of converting HTML/CSS to a PDF file is really nice. If you install my Pages2Pdf module, you have a separate module called WirePDF that is a wrapper around the mpdf library, optimized for ProcessWire. Here is a readme how you could use the module to save/download a PDF file from HTML markup or a ProcessWire template: https://github.com/wanze/Pages2Pdf#wirepdf1 point
-
Usually when I need to truncate something it's because it needs to be a summary that fits appropriately in a defined area and consistently with other items of the same type. As a result, having HTML in the truncated text is no good, so I'll include a strip_tags() as part of the truncation process, then wrap it in my own <p> or what not. Most of my sites have a shared truncateText() function somewhere in there that works kind of like this. Maybe there should be one in PW's core, not sure. function truncateText($text, $maxlength = 200) { // truncate to max length $text = substr(strip_tags($text), 0, $maxlength); // check if we've truncated to a spot that needs further truncation if(strlen(rtrim($text, ' .!?,;')) == $maxlength) { // truncate to last word $text = substr($text, 0, strrpos($text, ' ')); } return trim($text); } $summary = truncateText($page->body); echo " <a href='$page->url'>$page->title</a> <p class='summary'>$summary</p> ";1 point
-
1 point
-
You could also do it like below. I'm thinking you'd want to sort by 'title' or 'date' rather than by 'url'? $related = $page->yourpagefield->import($pages->find("yourpagefield=$page"))->sort("title"); if(count($related)) { echo "<h2>Related</h2>"; foreach($related as $item) echo "<li><a href='$item->url'>$item->title</a></li>"; }1 point
-
Thanks all. I have summarized the solution suggested by Soma in two examples (for future reference): Example 1: Simple example that lists your related yourpagefield articles - first pages referred by this page, next pages that refer this page. <ul> <?php foreach($page->yourpagefield as $k=>$p) { echo "<li><a href='{$p->url}'>$p->title</a></li>"; } foreach($pages->find("yourpagefield=$page") as $p){ echo "<li><a href='{$p->url}'>$p->title</a></li>"; } ?> </ul> Example 2: List related pages based on the yourpagefield field (all referring pages are sorted alphabetically, the block is only output when related pages exist). <?php if(count($page->yourpagefield)>0 || count($pages->find("yourpagefield=$page"))>0 ): ?> <h2>Related</h2> <ul> <?php $ref = array(); foreach($page->yourpagefield as $k=>$p) { $ref[$p->url] = $p->title; } foreach($pages->find("yourpagefield=$page") as $p){ $ref[$p->url] = $p->title; } asort($ref); #shuffle($ref); foreach($ref as $url=>$title) { echo "<li><a href='{$url}'>{$title}</a></li>"; } ?> </ul> <?php endif; ?>1 point