Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/16/2016 in Posts

  1. ...just stumbled over https://www.tawk.to/ never tried it, but it looks great and one of my friends recommended it on facebook. anyone here ever used it? unfortunately i'm too busy to try it out right now.
    4 points
  2. I had several clients request a version of this module that honors the aspect ratio of a video when using the responsive embed method. For now, the module is using a hard-coded 16/9 ratio. I decided to give it a go myself and forked Ryan's repo. I added functionality to calculate a video's aspect ratio from the oEmbed return values for width and height and made a change to the module's custom db schema to save the aspect ratio. In the (improbable) case the aspect ratio can't be determined, I added a fallback aspect ratio to the module's config. After looking around for a bit, this post about db schema updates for modules with custom databases provided excellent examples on how to handle the schema updates for existing installations. The changes have been tested on several live sites (3.0) and the update went without hiccups. If anyone's interested, here's the commit: https://github.com/[...]/commit/76e9a5e7bba79aef8fae35aaa7a1b7b79e970f90 I'd love to get some feedback on this! Especially from people running this on the 2.7 or 2.8 branch. If all works well, it'd be great to integrate this into @ryan's official repo at some point.
    4 points
  3. thanks again for this awesome field! if anybody needs excel-like tables this is easily possible like this (startingpoint): create a folder like /site/modules/HandsonTable copy https://github.com/handsontable/handsontable to this folder create a runtime field with this content: return wireRenderFile('../modules/HandsonTable/HandsonTable.php'); create your php-file /site/modules/HandsonTable/HandsonTable.php <?php $config->scripts->append($config->urls->siteModules . "HandsonTable/handsontable/dist/handsontable.full.js"); $config->scripts->append($config->urls->siteModules . "HandsonTable/handsontable/dist/moment/moment.js"); $config->scripts->append($config->urls->siteModules . "HandsonTable/handsontable/dist/pikaday/pikaday.js"); $config->styles->append($config->urls->siteModules . "HandsonTable/handsontable/dist/handsontable.full.css"); $config->styles->append($config->urls->siteModules . "HandsonTable/handsontable/dist/pikaday/pikaday.css"); ?> <div id="example"></div> <script> var data = [ ["", "Ford", "Volvo", "Toyota", "Honda"], ["2016", 10, 11, 12, 13], ["2017", 20, 11, 14, 13], ["2018", 30, 15, 12, 13] ]; var container = document.getElementById('example'); var hot = new Handsontable(container, { data: data, rowHeaders: true, colHeaders: true }); </script> moment and pickaday are not needed in this example and just as a showcase and reminder... It get's a little more complicated if you need storing/editing features but i need it only to show some data and my client can copy/paste data to excel/google drive sheets.
    3 points
  4. I think it was just an observation, no offence there It is good to see you trying again to build something with this piece of software.
    3 points
  5. you have to find the repeater events for the month, so you first have to apply a runtime property to each repeater event for the the month... $newsletterrepeater = $thispage->newsletterrepeater; $months = array(); foreach($newsletterrepeater as $n) { $months[] = date("m",$n->getUnformatted("newsletterdate")); $n->month = date("m", $n->getUnformatted("newsletterdate")); } $months = array_unique($months); rsort($months); foreach($months as $m) { $monthName = date('F', mktime(0, 0, 0, $m, 10)); $monthNews = $newsletterrepeater->find("month=$m"); echo '<table><tr><th colspan="3">'.$monthName.'</th></tr>'; foreach ($monthNews as $archivenews) { echo '<tr><td>'.$archivenews->newsletterdate.'</td>'; echo '<td>'.$archivenews->newslettertitle.'</td>'; echo '<td><a href="'.$archivenews->newsletterlink->url.'">View File</a></td>'; } }
    3 points
  6. Try $p = $pages->get("/"); or $p = $pages->get("template=home"); or $p = $pages->get("name=home"); Please, better do not use $page = ..., instead use $p or some other varname. $page is a prepopulated API var from PW what holds the current page.
    2 points
  7. For getting the home page it has to be like this: $pages->get("/");
    2 points
  8. Ok I fired up a test webshop and integrated the tawk live chat to find out the hows and whats http://dev3.pe.hu scroll down and you find it at the bottom right corner. What do you think ? The only catch seems to be the "powered by tawk.to" but hey it is offered as a free service. But statistics and chat data are processed on tawk.to and are not under your control. I can imagine that depending on the products or service you sell, customers will not like that. It all depends of course but privacy and what is tawk.to going to do with the processed data (third parties) needs to be considered and thought over. But then again this is the same for any live chat you would have on your website/shop. Perhaps a live chat under your own control on the same server as where your website/shop is would be a better idea ?
    2 points
  9. v066 is up. The biggest thing is a new hook where you can disable a submodule or even tweaks too, based on your custom conditions. Before this hook there was no way to disable a tweak, only to disable the entire submodule or restrict by role from the module settings page. I haven't tested disabling each tweaks so please report if you think something is not working as expected. The readme contains an example on how to use the hook. There were a few CKE plugins added too and it is possible to use cke.js or cke.css from the templates directory to override things. See the readme for details. Changelog added hook AdminOnSteroids::modifyConfigData to enable or disable submodules or tweaks added helper method AdminOnSteroids::disableSubmodule to disable a submodule new helper method AdminOnSteroids::disableTweak to disable a tweak new CKEaddon plugins: oEmbed, showBlocks, CodeMirror CKEaddons: use "/site/templates/cke.js" file for custom config (if exists) CKEaddons: use "/site/templates/cke.css" file for custom styles (if exists) use asmSelect for selecting CKEaddons plugins in module config (enables ordering) CKEaddons plugins that add buttons are marked with an asterisk JS fix for compact header save button and search field overlap (RenoTweaks) various LightWire skin CSS fixes (CKEaddons)
    2 points
  10. Thanks for posting this free live chat service. Actually one of my clients asked for a live chat on his webshop. It looks like there is no catch with this tawk live chat so lets find out. Gonna fire up a test site and play around with it and will post back about it later on.
    2 points
  11. I think Ryan is the only one to answer this without pure guesswork. But he probably did implement what padlooper does on his own. I mean nobody says you need padlooper to build a shopping cart. It just might be faster not to implement and test everything on your own by using it.
    2 points
  12. Today I managed to get it working for the three version. Tested. In the file FrontendUserRegisterEmailValidation.module line 110 I replaced the following code : // Load the plain / html email templates $emailContentHtml = wire('page')->render(wire('fu')->getFile('validationEmail.php', 'templates'), $vars); by this code : // Load the plain / html email templates $file = wire('fu')->getFile('validationEmail.php', 'templates'); $emailContentHtml = wireRenderFile($file, ['options' => $vars], ['default_path' => '']); As wireRenderFile was introduced in ProcessWire 2.5.2, there is no problem of compatibility. We can now receive email validation on PW 3.x with all information to create new user account
    2 points
  13. This page points to a forum post that is no longer valid (probably because of the Forum update?). Current url: Anyway, it is easier to install a beta version of the profile which is also good for checking out how it was made (blog-site2.zip linked from this post): For a more up-to-date blog profile I recommend:
    2 points
  14. Simply said: YES! There are more then one, but ... The biggest point is, that you don't need any module to run complex sites and very complex sites with PW. PW at first is a framework, and then a CMS on top of that framework. I can put all my application logic into template files and the site/init.php, site/ready.php and site/finish.php via hooks. No need for modules at first place. So, in a second place, modules also can be very valuable. We have some of them in the directory. And of course, PW 3 should be able to run with most of them, at least if there is stated that they are compatible with PW 2.7. As a side information: The modules do not belong to the PW core. Most of them, (if not all minus ryans personal modules) are from "third party" authors. So, as of now, PW 3 is DEV-branch, and most of the modules authors simply haven't updated their module directory entries. But this is not that relevant. If you are interested in using a module with a PW version that is not listed there, you can ask in the dedicated support forum thread of that module. Here you normally will get fast answeres, I believe. But now to the biggest second point, why it is useful to use PW 3, when most of the modules in the directory stated as not compatible with it: https://processwire.com/blog/posts/processwire-3.0.14-updates-file-compiler-fields-and-more/ PW3 has a file compiler for template files and modules, that in 99% of the PW 2.7 modules simply make them compatible with PW3. Nice eh? (And if you are unsure, ask in the dedicated support forum thread) Thank you for reading and enjoy PW3, (or what ever you like)!
    2 points
  15. One of PW 3.010's major novelty was the introduction of Horst's new image resizing engine that uses ImageMagick. Now I understand that ImageMagick can convert images to Webp, the image format that Google says can reduce image size up to 34% compared to JPEG. Mozilla is apparently adding support to Firefox, and even the Safari team is playing with it, so it looks like Webp is soon going to be available in most major browsers. If Horst's module can be extended to add Webp conversion, that would be a great addition to PW's already very powerful image manipulation arsenal. I'm currently using the free ImageEngine Lite to serve Webp images to supporting browsers, and the results are impressive. I routinely get images that are between 25 and 60% smaller compared to JPEG, with the same visual quality. I would love to eliminate the need to rely on a third-party service though.
    1 point
  16. I am new to processwire and I want to have a processwire site where people click a link to report a page then I login to the admin panel and see all the pieces of content, or pages that were reported. Then I choose to delete the page or keep it up and class the report as "read" instead of unread so it's no longer on my system. However I don't see any good tutorials on how to create modules, and the module API is just a list of functions, so there's no way for me to know how to get started coding this. In fact I am trying to see if creating a site like this would be much quicker than using a framework like CodeIgniter, Laravel, Yii or CakePHP.
    1 point
  17. Here is a screenshot of the backend admin of the the tawk.to live chat. It is very detailed and has a lot of options.
    1 point
  18. Thanks a million for the detailed walk-through and the full script @horst! I wouldn't have been able to do this without your expertise. You even took the time to test your script, which makes me more confident. It never ceases to amaze me how helpful the PW community is. I'm sure this will help other people who, like me, would like to upgrade but were not sure how to. I'll definitely take the site down before launching the upgrade, and do a full backup of the site beforehand in case something goes wrong.
    1 point
  19. Sure I've already suggested not to "pollute" the "root" (/site/templates) and a the possibility to configure it is welcome.
    1 point
  20. CKEddons is a great timesaver for me too. Setting up one ckeditor can be made quickly but when you have more its a nuisance. I have also thought about custom paths but have wait until someone asks for it. It didn't took much time Do you think the same for admin.css/js?
    1 point
  21. I really enjoy the CKEaddons. Till now I have always installed the addons manually but AOS makes my life much easier from now on. Thanks!!
    1 point
  22. @desbest...welcome to PW and the forums. Actually, the code in the Blog profile is not really meant for beginners...If you want to learn how to structure your template files I'd recommend these two tuts: http://processwire.com/docs/tutorials/default-site-profile/ http://processwire.com/docs/tutorials/how-to-structure-your-template-files/
    1 point
  23. You are right, the recommended blog profile is missing some features that is implemented in Ryan's profile, but to my knowledge it is the most current blog profile that has been released recently. I myself use it as a base of my future projects too, and currently refactoring it to my needs and also to make it more beginner friendly than it is right now. My version of it still needs a lot of work, and probably will be done by the end of this year. I will also try to document it as much as time permits. You should definitely need to familiarize yourself with the basics of template files, I can recommend reading these: A 4 part series (based on Twig, but worth reading nevertheless): http://blog.mauriziobonani.com/processwire-basic-website-workflow-part-1/ and this one too: https://www.smashingmagazine.com/2016/07/the-aesthetic-of-non-opinionated-content-management-a-beginners-guide-to-processwire/
    1 point
  24. It would be very easy to change from CroppableImage to CroppableImage3, but the old Thumbnail / CropImage uses a none-conform variation naming. It uses prefix_basename.ext, but since PW 2.5.11 we have basename.-suffix.ext. The way to go would be to use a bootstrap script that iterates over all pages, looking for Thumbnailfields, and if one is found, iterate over all images and (to be save!) in a first run copy the old variations to imagevariations with the new naming scheme. After successfully copied all crop variations, you should make a DB backup!! Than you can install the CroppableImage3 module and change the fieldtype of your images field to point to it. (Do a copy of your croppsettings before changing the type) Now you need to update your template files to use $page->image->first->getCrop('grande') instead of $page->image->first->getThumb('grande') After checking if all works well, you may run a variation of the bootstrap script that delete the old prefix_basename.ext variations instead to copy them to new naming scheme. Then uninstall the old Thumbnail module. As you said it is a lifesite, I suggest to run the bootstrap copy of the variations under PW 2.7 version. This would have no effect on your site. You also may upgrade the Thumbnail module to the CroppableImage (intermediate) module first, what can be done completly under PW 2.7. This way, you would not have to update two parts at once (PW no namespace to namespace, Imagefieldtype from old to new over different naming schemes). Upgrading from CroppableImage to CroppableImage3 is easier. But, if you can lock down your site for 20 to 30 minutes while switching to PW 3, changing images fieldtype and updating template files, it should be save to change from Thumbnail to CroppableImage3 directly. <?php // for PW 2.7 (UPDATED with @jacmaes bugfix for $new filename from below post!) $debugIteration = true; // true to iterate only over the first page with a desired field, false to iterate over all pages $doFilecopy = false; // true to really copy variation files, false for debug purposes $oldFieldtype = 'CropImage'; // CropImage $newFieldtype = 'CroppableImage3'; $timelimit = 60; // per single page // bootstrap PW include(dirname(__FILE__) . '/index.php'); // collect fields and cropsetting names $collection = array(); echo "<ul>"; foreach($fields as $f) { if($f->type != 'Fieldtype' . $oldFieldtype) continue; $collection[$f->name] = array(); echo "<li>{$f->type} : {$f->name}</li>"; $thumbSettings = preg_match_all('#(.*?),.*?\n#msi' , trim($f->thumbSetting) . "\n", $matches, PREG_PATTERN_ORDER); if(!$thumbSettings) continue; $collection[$f->name] = $matches[1]; echo "<ul>"; foreach($collection[$f->name] as $suffix) { echo "<li>{$suffix}</li>"; } echo "</ul>"; } echo "</ul>"; echo "<hr />"; // now iterate over all pages and rename or copy the crop variations echo "<ul>"; foreach($pages->find("include=all") as $p) { set_time_limit($timelimit); // reset the timelimit for this page foreach($collection as $fName => $suffixes) { if(!$p->$fName instanceof Pageimages) continue; $images = $p->$fName; if(0 == $images->count())continue; echo "<li>{$p->title}<ol>"; foreach($images as $image) { echo "{$image->name}<ul>"; foreach($suffixes as $suffix) { $old = dirname($image->filename) . "/{$suffix}_" . $image->name; $new = dirname($image->filename) . "/" . str_replace(".", ".-{$suffix}.", $image->name); echo "<li>$suffix<ul><li>$old</li><li>$new</li></ul>"; if($doFilecopy) { if(!file_exists($old)) { echo "ERROR: original variation is missing!"; } else { if(file_exists($new)) { echo "file already exists"; } else { $res = @copy($old, $new); echo "filecopy: " . ($res ? "Success!" : "!ERROR: $res"); } } } echo "</li>"; } echo "</ul>"; } echo "</ol></li>"; if($debugIteration) break; } $pages->uncache($p); // just in case we need the memory } echo "</ul>"; exit(); I have tested this with one page and two images, where I have done a little damage too. This was the output:
    1 point
  25. It works now. Thank you. It looks like the 2nd blog profile will have to do, as the 1st one doesn't work with v3 or v2.8. Also the 2nd blog profile has less features such as there being no tags or dedicated comments page, so it'll be harder for me to learn how to use processwire now, as I can't access those examples from the 1st blog profile. If the 2 blog profiles are outdated, should I refer to the documentation page to learn how to create templates?
    1 point
  26. Cool, thanks for sharing! Could you please also edit the first sentence of the post above the code? Maybe by crossing it out, and explaining the situation right after it. Leaving it like this is misleading when skimming through the posts and not reading every single character.
    1 point
  27. Looking into it a little more, I have done both before and after in different scenarios: https://gist.github.com/adrianbj/6fd1b770d9ce7a7252b6 https://gist.github.com/adrianbj/e391e2e343c5620d0720 https://github.com/adrianbj/AdminRestrictBranch/blob/master/AdminRestrictBranch.module#L108 The first two I haven't used in a long time, but the last one I use regularly, but it's not manipulating the same way you are looking for. Perhaps you could see if one of the first two works for you though in 3.x - sorry I don't have more time right now to help debug.
    1 point
  28. I'm interested in it, so if you could just jot it down as a short case study after you have finished the site, that would be cool
    1 point
  29. Thanks for your thoughts @szabesz - it's a pretty complex site with most sections only relevant to people in the USA, although it adds value to users from other countries/languages to see the content from other regions, even though it's not translated. Down the road I can see that we'll have other sections that are only specific to other languages. Ideally, the overview pages will be translated into all these languages at some point. I think I have a decent approach now - I was just wondering what the general principle is when parts of a site are translated and other parts aren't, and dealing with setting the hreflang tag, but I think in my case I need some custom logic which is what I have done.
    1 point
  30. ok fixed - hopefully this example can work for your scenario...
    1 point
  31. @Spica the new version is only compatible with PW version 3.x. Last release with PW 2 compatibility: Download here.
    1 point
  32. After some testing I came to the conclusion that we don't need the AJAX code. In fact it makes the code incompatible with the other extra actions. At the end of the day, the code becomes even simpler! It's been edited to show the final, simpler version.
    1 point
  33. As horst explained a lot (most?) of modules will work just fine on, even if compatibility is not yet explicitly listed. But most of all: a lot of new stuff and upgrades have gone into PW3, starting from https://processwire.com/blog/posts/processwire-2.6.20-and-surprise-processwire-3.0-alpha-1/ and basically every following blog post.
    1 point
  34. @desbest Uhm sorry for any confusion. @flydev is right. Welcome back to PW and the forums!
    1 point
  35. Yeah sure, you're right. I usually do not call class methods from within the hooks executed function, which made me miss that.
    1 point
  36. With return via $event->return, the module stops working. The used return is inside the Ajax process, not the hook. If we change the return, the module doesn't get an ajax response and doesn't update the page (keeps the ajax spinner forever). However, I'm not that knowledgeable in ProcessWire. Does this make sense?
    1 point
  37. Probably it is more of a UI/UX design issue than a technical one. I think the default behavior of the menu item not showing up when the page is not available in a given language is ok, at least that is what I would go with anyway. If you just simply include the not translated page in the menu linking to its English counterpart, the visitor might easily believe that it is an error and/or the page has not been translated by mistake. You might want to find other means to present these pages in question to the visitors. For example if your site menu is not huge, you can put two site tree like menus in a "mega footer", labelled: "Pages in Portuguese:" and "Pages in English", so that visitors interested in the English version can still find it. Sure, pages are still a bit hidden this way, but it is just one idea of solving this, you might want something else that is more sophisticated than this.
    1 point
  38. Ok, so the problem with making a language not checked "active" for a pages is that the page disappears from menus when viewing in that language. So obviously I could either override that active check when generating the array of pages for the menu, or I could use another method for determining whether to show a hreflang tag for that language for that page. I don't want English-only pages hidden from users who are viewing the site in Portuguese, but I also don't want Google thinking that there is a PT specific page when there isn't. I am assuming it's good practice to keep the /pt/ in the URL even when there is no PT language version for that page? Otherwise if the page redirected to the default/english version, then if they navigated back to the pages that do have a PT version, then they would have to change the language again. I think the logical thing is to not use: $page->viewable($language) to determine whether to add a hreflang for the language, but I would love to know what you guys do when you have a site that is only ML for certain sections, but you want all sections to be available to all users - they can of course always use Google Translate for the other sections so I don't want them hidden/not active. Sorry for rambling - just trying to figure out what the best practice is here. Thanks in advance!
    1 point
  39. It all depends on name formatting of the old crop variations! Please, to be sure, can you give one or two examples of the filenames (original image + varition name of the crop)? Also, how do you call them in templates. (with the older CroppableImage and the CroppableImage3, we use $image->getCrop("suffix")). I'm sure, we will find a practicable solution, but want to be thouroughly and careful. EDIT: How many cropsettings / thumbsettings are defined with a typical field in your sites? Can you post an example of the textarea content?
    1 point
  40. They finally released 1.0: https://quilljs.com/blog/announcing-quill-1-0/
    1 point
  41. This is the way I use to integrate both worlds together. 1.- _header.php ( or whatever is called the file that contains your <body> tag ) <head> ... <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script> <script>var app = angular.module('myApp', [])</script> </head> <body ng-app="myApp"> ... 2.- yourTemplate.php <script> app.controller('myCtrl', function ($scope) { $scope.myvar = []; $scope.myvar = <?=getChildren("template=yourtemplatename")?>; console.debug("my Object form php",$scope.myvar); }); </script> <!-- now $scope.myvar is accesible --> <div ng-controller="myCtrl"> </div> 3.- getChildren is a function that I include in _func.php function getChildren($pageId) { $pagina = wire('pages')->get($pageId); // fields to be avoided $avoid = array("FieldtypeFieldsetOpen", "FieldtypeFieldsetClose","FieldtypeFieldsetTabOpen","FieldtypeFieldsetTabClose"); // fields that must be returned $wanted = $fields; // selector $paginas = $pagina->find($selector); $arr = array(); foreach ($paginas as $child) { $array = array(); foreach($child->fields as $field) { $array['id'] = $child->id; // if we dont' want all fields back if ( !in_array($field->type, $avoid) && in_array($field->name, $wanted) && (count($wanted)>0) ) { $array[$field->name] = htmlspecialchars($child->get($field->name)); } // we want all fields back if ( !in_array($field->type, $avoid) && (count($wanted)==0) ) { $array[$field->name] = htmlspecialchars($child->get($field->name)); } } array_push($arr, $array); } echo json_encode($arr); }
    1 point
  42. Have a look at this one: https://github.com/EX3MP/generator-processwire
    1 point
  43. Ok, I will take care of the translation to DE tonight...
    1 point
  44. Awesome work! Any chance of a demo being made available, or some kind of gallery or screencast so we can take a look at how it works?
    1 point
  45. If you install this module you´ll be able to use angular and use it in your templates directly. Example of a list of all children of the actual page. <script> app.controller('myCtrl', function ($scope) { $scope.children = []; $scope.children = <?=$page->getChildren()?>; }); </script> <div ng-controller="myCtrl"> <ul> <li ng-repeat="child in children">{{child.title}}</li> </ul> </div>
    1 point
×
×
  • Create New...