Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/27/2019 in all areas

  1. A year or so later, I have seen the future. Actually, I just stumbled upon it. Just when I was diving into Angular + TypeScript + NativeScript for mobile apps, I recently came across this thing, Flutter. I have been totally blown away! The last time I was this excited was when I discovered ProcessWire :-). Long story short, before I ended up here, I was looking at Kivy and BeeWare. I managed to pick up Python along the way. Kivy looks promising. I am interested in both mobile and desktop apps and it ticks those boxes. Then along comes Flutter and wow! Cross platform, write once deploy everywhere (iOS, Android, Embedded, Windows, Mac). It's still early days but I am totally convinced. I was a bit hesitant because it is a Google project (you know, their history of killing off projects...) but since it is open source and there are some big players already involved, I am sold. Flutter compiles to machine code! It comes with lots of widgets out of the box, both for iOS and Android. You can also ask it to compile to JavaScript (like TypeScript can and does). To program in Flutter you use Dart, a language developed by Google. I came across Dart a while back. Back then, it was considered a dead language. It has made a resurgence, thanks to Flutter. If you know your OOP and JavaScript, it is very easy to pick up, in an hour or so. If looking at Flutter, have a look at Hummingbird as well. What do you folks think? Anyone used Flutter before?
    3 points
  2. I've found this module really useful, and thought I'd share an interesting use case I've come up with for it. I had a client who wanted both the functionality of pageTable, and PageTableExtended, ie they wanted a tabular summary like PageTable provides, but with the option to expand or collapse to display rendered detail from a template like PageTableExtended allows. It turns out, I was able to provide the desired functionality using PageTableExtended, and built in UI-kit classes in the template file I provided to PageTableExtended. <!-- This is the summary section, like displayed by PageTable --> <table class="AdminDataTable AdminDataList uk-table uk-table-divider uk-table-justify uk-table-small"> <thead> <tr> <th>BOM</th> <th>Cases to produce</th> <th>+/- or exact</th> <th>Notes</th> </tr> </thead> <tr> <td><?= $bom->title ?></td> <td><?= $page->cases ?></td> <td><?= $page->exact ?></td> <td><?= $page->notes ?></td> </tr> </table> <!-- Toggle to display detail section --> <a herf="#" class="toggleRenderedLayout"> <i class="toggle-icon fa fa-angle-right"></i> </a> <span class="renderedLayoutTitle">BOM Details</span> <!-- Detail section, hidden by default, using built in ui-kit css. --> <div class="renderedLayout hiddenOnStart"> <div uk-grid uk-margin-small-top> <div class="uk-width-1-3 uk-margin-small-top"><strong>Wine Variety </strong><?= $bom->wineVariety->title ?></div> <div class="uk-width-1-3 uk-margin-small-top"><strong>Brand </strong><?= $bom->brand->title ?></div> <div class="uk-width-1-3 uk-margin-small-top"><strong>Market </strong><?= $bom->market->title ?></div> <div class="uk-width-1-1 uk-margin-small-top"><strong>Orientation </strong><?= $bom->orienation->title ?></div> ... </div> </div> Screenshot, showing the tabular summary, with the detail section expanded.
    2 points
  3. It doesn't look like there is a way to keep HTML comments intact when using the core Markup Regions feature. Even if there was a way to set the "exact" option you mentioned (which there isn't currently because the Markup Regions methods aren't hookable), comments are also removed here. You could make a feature request at GitHub for an option to keep HTML comments.
    2 points
  4. In addition to that I wrote this: https://copypaste.pw/howto/author-box/ Maybe it helps or at least gives you directions.
    2 points
  5. @ryan thank you very much for all the additions you implemented in such a short time on top of my github pullrequest. It seems that there currently nothing is left in regard of webp support in ProcessWire. But I already have one or two points for future updates to the image rendering engines, that should be implemented when all browsers will support webp and we don't need fallback jpegs or pngs anymore. ?
    2 points
  6. Do you mean you tried to upload a WebP image to an Images field? If so that's not supported - the blog post explains that WebP is an output format only:
    1 point
  7. The API will change a bit. Everything goes through Padloper (the new module/class I talked about in the post above). An Order Object will contain everything about the order stored in several properties. For the curious, there are two main fields for an order (outside order ID, etc). One field is of type Order and contains the overall data about an order, e.g. total price, total quantity, total shipping, customer name, customer address, order status, etc. The second is for individual items (also called list items) in an order. This will hold data about each item (product) in an order, e.g., the price, quantity, fulfilment status, variant id, tax, etc. To send order data to your endpoints will be as simple as this: // get an order $order = $padloper->getOrder($id); /* overall order data */ // total price/cost $order->totalPrice; // total discounts applied $order->totalDiscount; // totalShipping $order->totalShipping; // order items $items = $order->items; foreach($items as $item) { $item->title; $item->price; $item->totalPrice; $item->fulfilmentStatus; } // explode $data = $order->items->explode(array('title','price','tax')); $json = json_encode($data); As you can see, you can cherry-pick what you want to send to other services. Also note that each item within an order has its own fulfilment status. This is helpful in tracking each items status. I will give an update after I finish with this post, specifically about discounts. You will still be able to hook into prices if you wish but we have 4 types of discounts in-built that cover most scenarios. Yes :-). Our shipping classes and modules are all ready. I only need to implement the backend GUI. Briefly though, shipping is made up of these: Shipping Zone: Geographical, from post/zip code all the way up to continent. Shipping Rates: Light goods, heavy, 10 items, $30 order, flat, etc. Shipping Methods: Normal, Super Fast, Slow, Next Day, etc. Shipping Option: A combination of Shipping Rate and Shipping Method: e.g. Your order falls under the shipping rate 'Heavy Goods'. If you want them fast, you pay $40. If are in no hurry, you pay $10.,etc Using the GUI, you will create your shipping zones. Each zone can have its own rates, methods and options. I have spoken about shipping zone before. Please see this post. Yes, but not now. Probably after the release of Padloper 2. We have two existing Payment Modules that we can work with, although they too will be polished a bit (given the various suggestions we've seen in the forums). Definitely :-). In your example, Licence 1 and 2 are just variant options themselves. See the demo below. I am planning to hire a number of octopuses so we can type faster ?. Seriously though, I am working as hard as I can. Maybe after the summer. Please see the first post in this thread, under Pricing Model. Thanks all!
    1 point
  8. 301 are totally fine - for ProcessWire and Google. Nothing to worry about. Read next part - as you have almost nothing to do for this. ? The existing ProcessWire .htaccess file already has this in place. Uncomment two lines and you are ready to go. # ----------------------------------------------------------------------------------------------- # 13. OPTIONAL: Redirect users to the 'www.' version of the site (uncomment to enable). # For example: http://processwire.com/ would be redirected to http://www.processwire.com/ # ----------------------------------------------------------------------------------------------- # RewriteCond %{HTTP_HOST} !^www\. [NC] # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] You can just add those fields to the user template - which can be found in Setup > Templates (after enabling showing system templates). And of course you have to create those fields first - if not already created. Setup > Fields There you can create all kinds of fields. Text, textarea, image, whatever... I recommend doing the tutorials available here: https://processwire.com/docs/tutorials/ They will help you to understand ProcessWire. It's absolutely not a waste of time. Even as someone who never worked with ProcessWire, but having some basic knowledge in terms of PHP, can learn ProcessWire within a weekend.
    1 point
  9. I've come up with some seriously fast ways of doing this – following the suggestion from @Zeka and taking inspiration from the code in RockFinder. I'm posting them here in case anyone finds them useful. The RockFinder approach in my previous post takes about 0.95 seconds (across about 5,000 pages with about 1,500 associated images, resulting in about 30 pages in the final array), which is fine. But the following, using direct SQL access, produces exactly the same result in around 0.0055 seconds (much of which is making the final page array, so if there were more pages it would be somewhat slower). startDate = strtotime("-2 months"); // Run query on database $startDateString = date('Y-m-d H:i:s', $startDate); $queryString = "SELECT pages_id FROM field_article_images WHERE created >= '{$startDateString}'"; $queryResult = $this->db->query($queryString); // Get array of unique page IDs $pageIdArray = $queryResult->fetch_all(MYSQLI_NUM); $pageIdArray = array_unique($pageIdArray, SORT_REGULAR); // Make PW page array $pagesWithRecentImages = new PageArray(); foreach($pageIdArray as $pageIdSubArray) { $pwPage = $pages->get($pageIdSubArray[0]); $pagesWithRecentImages->add($pwPage); } And if an array of image data from the database table would be sufficient, the following is even faster, at around 0.0014 seconds. $startDate = strtotime("-2 months"); // Run query on database $startDateString = date('Y-m-d H:i:s', $startDate); $queryString = "SELECT * FROM field_article_images WHERE created >= '{$startDateString}'"; $queryResult = $this->db->query($queryString); // Make array of image data $imageData = $queryResult->fetch_all(MYSQLI_ASSOC); (Adding "ORDER BY created DESC" to the SQL query above could be a useful addition.) It's worth noting that the SQL queries above are quite straightforward because they are on a single table, and the image field in question appears only on relevant pages. For more complex situations, using RockFinder would be a great deal easier, and I'd guess the speed difference would be less.
    1 point
  10. UPDATE OK, after I've faced that for and against again, I've decided to make the module freely available. If you are interested, you can test the current state of development. I already put the module on GitHub. Please note that the software is not yet intended for use in a production system. (Alpha version). For example, the configuration and handling of the VAT rates are still missing. Also the dashboard is still incomplete. And many other things needs to be improved and implemented... ? If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests. https://github.com/gadgetto/SnipWire
    1 point
  11. One image is actually indexed... ? There are a few things you might want to change or at least take a closer look at. use only https:// and redirect to it choose prefered domain (see below) reduce page size drastically (~13MB is too large) and speed it up remove the preloader as it stays for hours fix your sitemap (as mentioned by @dragan) set up Google Search Console to figure out problems with your site add robots.txt (as mentioned above) and reference your sitemap and maybe add a nice favicon.ico Your site is available through 4 different addresses: http://lobo-taberna.de/ http://www.lobo-taberna.de/ https://lobo-taberna.de/ https://www.lobo-taberna.de/ Choose one. ? Reduce page size to ... way less than that.
    1 point
  12. I think these guys covered it really well, but here's an overly simple alternate example in case it helps. class YourModule extends WireData implements Module, ConfigurableModule { public static function getModuleInfo() { return array('title' => 'Your Module', 'version' => 1); } const defaultValue = 'renobird'; public function __construct() { $this->set('yourname', self::defaultValue); // set default value in construct } public function init() { // while you need this function here, you don't have to do anything with it // note that $this->yourname will already be populated with the configured // value (if different from default) and ready to use if you want it } public function execute() { // will return configured value, or 'renobird' if not yet configured return $this->yourname; } public static function getModuleConfigInputfields(array $data) { // if yourname isn't yet in $data, put our default value in there if(!isset($data['yourname'])) $data['yourname'] = self::defaultValue; $form = new InputfieldWrapper(); $f = wire('modules')->get('InputfieldText'); $f->name = 'yourname'; $f->label = 'Enter your name'; $f->value = $data['yourname']; $form->add($f); return $form; } } If you have the need to manage several configuration values, then you can save yourself some time by using a static array of default values like in the examples before mine. Also this: foreach(self::$configDefaults as $key => $value) { if(!isset($data[$key]) || $data[$key]=='') $data[$key] = $value; } could also be written as this: $data = array_merge($data, self::$configDefaults);
    1 point
×
×
  • Create New...