Leaderboard
Popular Content
Showing content with the highest reputation on 05/07/2018 in all areas
-
I'm making progress! Current state is really, really nice. See these two examples of a feedback software that I've built for a client: full multi-language-support all kinds of custom cell stylings (backgrounds, icons, etc) custom filters filter by doubleclick on a cell (really handy) custom buttons-plugin (not part of aggrid): reload data via ajax (very performant thanks to RockFinder) reset filters fullscreen mode (really handy for large grids) excel export as CSV data reload grid automatically when a pw-panel is closed Another example: A list of all ratings for several categories See the bottom line: this is another plugin that is not part of aggrid. You can just show the sum of the column (like the second column) or render custom statistics (like min, max, avg). When you select multiple lines you also get the statistics only for the selected rows This is also an example how you can use pinned rows with aggrid (really awesome library!). Example of a range filter (aggrid standard feature):4 points
-
New website for Nexoc GmbH in Munich, Germany. NEXOC. GmbH was founded in August 2003 and sells notebooks and PCs under the NEXOC brand name. The products are characterised by a particularly beautiful design and high quality and are available at an attractive price-performance ratio. We spell Individuality with a capital I! Each notebook and each PC from NEXOC. can be individually configured and designed in line with customer wishes and requirements - there is no challenge - there are only solutions, and these are what NEXOC. offers! Features: Multilingual Page-Builder done with PageTable Download Center: getting the informations from the database of an external application, caching the resultes with WireCache and show the results via Ajax frontend login for reseller Frontend: uikit3 OwlCarousel2 SpriteSpin jQuery Lazy grunt-sass grunt-contrib-uglify grunt-contrib-cssmin Backend: Jumplinks Upgrades Checker Simple Contact Form Schedule Pages Pages2Pdf Email Obfuscation Range Slider Image Extra Sitemap Tracy Debugger PageTable Extra Actions Some "behind the scenes":3 points
-
no geo ip api, but a HTTP api: get the users ip: https://stackoverflow.com/a/13646735 get location info: https://ipstack.com/ or http://ipinfo.io using https://processwire.com/api/ref/wire-http/get/3 points
-
Not a module, just a little function for applying effects to images if you have the Imagick PHP extension installed. This started out as a need to blur an image and then I expanded it to accept more of the Imagick methods. Not all Imagick methods are supported. The function takes the URL to a source image, the name of an Imagick method and an array of arguments for that method, and returns the URL to the processed image. The processed image is saved to same directory as the source image, with the method name and arguments appended to the name of the source image. Images are cached in that the function checks if an image with that name/method/arguments exists already to save recreating it on every page load. function imagickal($imagePath, $method, array $arguments) { $path_parts = pathinfo($imagePath); $dirname = $path_parts['dirname'] . '/'; $filename = $path_parts['filename']; $mod = $method . '-' . implode($arguments, '-'); $mod = wire('sanitizer')->filename($mod, true); $savename = $dirname . $filename . '_' . $mod . '.jpg'; if (!file_exists($_SERVER['DOCUMENT_ROOT'] . $savename)) { $image = new Imagick($_SERVER['DOCUMENT_ROOT'] . $imagePath); call_user_func_array([$image, $method], $arguments); $image->writeImage($_SERVER['DOCUMENT_ROOT'] . $savename); } return $savename; } I'm a PHP novice so happy to receive suggestions of how this could be improved. Imagick reference: http://php.net/manual/en/class.imagick.php Examples of some effects possibilities...3 points
-
This week's version of ProcessWire on the dev branch continues resolution of GitHub issue reports, and it also adds a new text truncation function to our $sanitizer API, something requested from our requests repository: https://processwire.com/blog/posts/processwire-3.0.101-core-updates/ We didn't have a blog post for last week's version 3.0.100—see the core updates section in ProcessWire Weekly #207 for more details on that version.2 points
-
My 2 cents on Udemy. You need to be selective/careful on Udemy. They seem to have a more lenient criteria on who can upload a course, and the quality of the courses can wildly vary as a result. I've seen some really good courses as well as some (god) awful ones. My advice is to have a look at the average ratings of the course, compare the score against other courses in the same domain, and also read the user reviews (both good/bad) and make a decision.2 points
-
Page Query Boss Build complex nested queries containing multiple fields and pages and return an array or JSON. This is useful to fetch data for SPA and PWA. You can use the Module to transform a ProcessWire Page or PageArray – even RepeaterMatrixPageArrays – into an array or JSON. Queries can be nested and contain closures as callback functions. Some field-types are transformed automatically, like Pageimages or MapMarker. Installation Via ProcessWire Backend It is recommended to install the Module via the ProcessWire admin "Modules" > "Site" > "Add New" > "Add Module from Directory" using the PageQueryBoss class name. Manually Download the files from Github or the ProcessWire repository: https://modules.processwire.com/modules/page-query-builder/ Copy all of the files for this module into /site/modules/PageQueryBoss/ Go to “Modules > Refresh” in your admin, and then click “install” for the this module. Module Methods There are two main methods: Return query as JSON $page->pageQueryJson($query); Return query as Array $page->pageQueryArray($query); Building the query The query can contain key and value pairs, or only keys. It can be nested and contain closures for dynamic values. To illustrate a short example: // simple query: $query = [ 'height', 'floors', ]; $pages->find('template=skyscraper')->pageQueryJson($query); Queries can be nested, contain page names, template names or contain functions and ProcessWire selectors: // simple query: $query = [ 'height', 'floors', 'images', // < some fileds contain default sub-queries to return data 'files' => [ // but you can also overrdide these defaults: 'filename' 'ext', 'url', ], // Assuming there are child pages with the architec template, or a // field name with a page relation to architects 'architect' => [ // sub-query 'name', 'email' ], // queries can contain closure functions that return dynamic content 'querytime' => function($parent){ return "Query for $parent->title was built ".time(); } ]; $pages->find('template=skyscraper')->pageQueryJson($query); Keys: A single fieldname; height or floors or architects The Module can handle the following fields: Strings, Dates, Integer… any default one-dimensional value Page references Pageimages Pagefiles PageArray MapMarker FieldtypeFunctional A template name; skyscraper or city Name of a child page (page.child.name=pagename); my-page-name A ProcessWire selector; template=building, floors>=25 A new name for the returned index passed by a # delimiter: // the field skyscraper will be renamed to "building": $query = ["skyscraper`#building`"] Key value pars: Any of the keys above (1-5) with an new nested sub-query array: $query = [ 'skyscraper' => [ 'height', 'floors' ], 'architect' => [ 'title', 'email' ], ] A named key and a closure function to process and return a query. The closure gets the parent object as argument: $query = [ 'architecs' => function($parent) { $architects = $parent->find('template=architect'); return $architects->arrayQuery(['name', 'email']); // or return $architects->explode('name, email'); } ] Real life example: $query = [ 'title', 'subtitle', // naming the key invitation 'template=Invitation, limit=1#invitation' => [ 'title', 'subtitle', 'body', ], // returns global speakers and local ones... 'speakers' => function($page){ $speakers = $page->speaker_relation; $speakers = $speakers->prepend(wire('pages')->find('template=Speaker, global=1, sort=-id')); // build a query of the speakers with return $speakers->arrayQuery([ 'title#name', // rename title field to name 'subtitle#ministry', // rename subtitle field to ministry 'links' => [ 'linklabel#label', // rename linklabel field to minlabelistry 'link' ], ]); }, 'Program' => [ // Child Pages with template=Program 'title', 'summary', 'start' => function($parent){ // calculate the startdate from timetables return $parent->children->first->date; }, 'end' => function($parent){ // calculate the endate from timetables return $parent->children->last->date; }, 'Timetable' => [ 'date', // date 'timetable#entry'=> [ 'time#start', // time 'time_until#end', // time 'subtitle#description', // entry title ], ], ], // ProcessWire selector, selecting children > name result "location" 'template=Location, limit=1#location' => [ 'title#city', // summary title field to city 'body', 'country', 'venue', 'summary#address', // rename summary field to address 'link#tickets', // rename ticket link 'map', // Mapmarker field, automatically transformed 'images', 'infos#categories' => [ // repeater matrix! > rename to categories 'title#name', // rename title field to name 'entries' => [ // nested repeater matrix! 'title', 'body' ] ], ], ]; if ($input->urlSegment1 === 'json') { header('Content-type: application/json'); echo $page->pageQueryJson($query); exit(); } Module default settings The modules settings are public. They can be directly modified, for example: $modules->get('PageQueryBoss')->debug = true; $modules->get('PageQueryBoss')->defaults = []; // reset all defaults Default queries for fields: Some field-types or templates come with default selectors, like Pageimages etc. These are the default queries: // Access and modify default queries: $modules->get('PageQueryBoss')->defaults['queries'] … public $defaults = [ 'queries' => [ 'Pageimages' => [ 'basename', 'url', 'httpUrl', 'description', 'ext', 'focus', ], 'Pagefiles' => [ 'basename', 'url', 'httpUrl', 'description', 'ext', 'filesize', 'filesizeStr', 'hash', ], 'MapMarker' => [ 'lat', 'lng', 'zoom', 'address', ], 'User' => [ 'name', 'email', ], ], ]; These defaults will only be used if there is no nested sub-query for the respective type. If you query a field with complex data and do not provide a sub-query, it will be transformed accordingly: $page->pageQueryArry(['images']); // returns something like this 'images' => [ 'basename', 'url', 'httpUrl', 'description', 'ext', 'focus'=> [ 'top', 'left', 'zoom', 'default', 'str', ] ]; You can always provide your own sub-query, so the defaults will not be used: $page->pageQueryArry([ 'images' => [ 'filename', 'description' ], ]); Overriding default queries: You can also override the defaults, for example $modules->get('PageQueryBoss')->defaults['queries']['Pageimages'] = [ 'basename', 'url', 'description', ]; Index of nested elements The index for nested elements can be adjusted. This is also done with defaults. There are 3 possibilities: Nested by name (default) Nested by ID Nested by numerical index Named index (default): This is the default setting. If you have a field that contains sub-items, the name will be the key in the results: // example $pagesByName = [ 'page-1-name' => [ 'title' => "Page one title", 'name' => 'page-1-name', ], 'page-2-name' => [ 'title' => "Page two title", 'name' => 'page-2-name', ] ] ID based index: If an object is listed in $defaults['index-id'] the id will be the key in the results. Currently, no items are listed as defaults for id-based index: // Set pages to get ID based index: $modules->get('PageQueryBoss')->defaults['index-id']['Page']; // Example return array: $pagesById = [ 123 => [ 'title' => "Page one title", 'name' => 123, ], 124 => [ 'title' => "Page two title", 'name' => 124, ] ] Number based index By default, a couple of fields are transformed automatically to contain numbered indexes: // objects or template names that should use numerical indexes for children instead of names $defaults['index-n'] => [ 'Pageimage', 'Pagefile', 'RepeaterMatrixPage', ]; // example $images = [ 0 => [ 'filename' => "image1.jpg", ], 1 => [ 'filename' => "image2.jpg", ] ] Tipp: When you remove the key 'Pageimage' from $defaults['index-n'], the index will again be name-based. Help-fill closures & tipps: These are few helpfill closure functions you might want to use or could help as a starting point for your own (let me know if you have your own): Get an overview of languages: $query = ['languages' => function($page){ $ar = []; $l=0; foreach (wire('languages') as $language) { // build the json url with segment 1 $ar[$l]['url']= $page->localHttpUrl($language).wire('input')->urlSegment1; $ar[$l]['name'] = $language->name == 'default' ? 'en' : $language->name; $ar[$l]['title'] = $language->getLanguageValue($language, 'title'); $ar[$l]['active'] = $language->id == wire('user')->language->id; $l++; } return $ar; }]; Get county info from ContinentsAndCountries Module Using the [ContinentsAndCountries Module](https://modules.processwire.com/modules/continents-and-countries/) you can extract iso code and names for countries: $query = ['country' => function($page){ $c = wire('modules')->get('ContinentsAndCountries')->findBy('countries', array('name', 'iso', 'code'),['code' =>$page->country]); return count($c) ? (array) $c[count($c)-1] : null; }]; Custom strings from a RepeaterTable for interface Using a RepeaterMatrix you can create template string for your frontend. This is usefull for buttons, labels etc. The following code uses a repeater with the name `strings` has a `key` and a `body` field, the returned array contains the `key` field as, you guess, keys and the `body` field as values: // build custom translations $query = ['strings' => function($page){ return array_column($page->get('strings')->each(['key', 'body']), 'body', 'key'); }]; Multilanguage with default language fallback Using the following setup you can handle multilanguage and return your default language if the requested language does not exist. The url is composed like so: `page/path/{language}/{content-type}` for example: `api/icf/zurich/conference/2019/de/json` // get contenttype and language (or default language if not exists) $lang = wire('languages')->get($input->urlSegment1); if(!$lang instanceof Nullpage){ $user->language = $lang; } else { $lang = $user->language; } // contenttype segment 2 or 1 if language not present $contenttype = $input->urlSegment2 ? $input->urlSegment2 : $input->urlSegment1; if ($contenttype === 'json') { header('Content-type: application/json'); echo $page->pageQueryJson($query); exit(); } Debug The module respects wire('config')->debug. It integrates with TracyDebug. You can override it like so: // turns on debug output no mather what: $modules->get('PageQueryBoss')->debug = true; Todos Make defaults configurable via Backend. How could that be done in style with the default queries? Module in alpha Stage: Subject to change This module is in alpha stage … Query behaviour (especially selecting child-templates, renaming, naming etc) could change1 point
-
I thought I'd start this topic because I seem to be recommending certain courses to people repeatedly, so why not share it with the PW community. The topic can be a review or overview of any IT or non IT-related courses you're doing or have done. I'll start off with a course on teaching you how to learn. https://www.coursera.org/learn/learning-how-to-learn I'm halfway through this course and I can already see huge improvements in the way I'm learning and also my approach to learning. I wished I've taken this course when I was a student! The course can be taken free, and all it takes is a couple of hours of your time. If you have kids that are in school, I think this should be compulsory viewing for all children in academia. If you're into self-improvement or learning, then I can't recommend this course highly enough.1 point
-
1 point
-
Hello, I know this is not a course but a series of userful books https://goalkicker.com/ These are some that could become handy with ProcessWire https://goalkicker.com/PHPBook/ https://goalkicker.com/SQLBook https://goalkicker.com/MySQLBook https://goalkicker.com/GitBook https://goalkicker.com/JavaScriptBook https://goalkicker.com/jQueryBook https://goalkicker.com/HTML5Book https://goalkicker.com/CSSBook1 point
-
Assuming your comments field is called comments then you get the count like that : $count = count($page->comments); or $count = $page->comments->count();1 point
-
Well I do use Bootstrap and I thought that JS could cause the issue and removed all calls from the code but still am experiencing the issue. WIll try with the CSS as I did not realize it could cause some issues as well if some styles overlap. Anyway I decided that changing the logo from the frontend is too much to provide considering the fact that the profile is not meant to be fully operated within the frontend, however let me remove the css and js calls and test it without them at leasr for the sake of the knowledge. Thanks @wbmnfktr for sharing thoughts1 point
-
Could be done, but I think there are probably better solutions already available such as AvbImage and PageImage Manipulator.1 point
-
Hey @Robin S! Thanks for the cool module! Did you ever think about making it chainable to PageImage?1 point
-
It depends on the products you work with. Clothing can be super work-intensive but by now all products and data I had to work with were easy to implement in JSON-LD as everything exists in that special ProcessWire page. So we can say: medium to lots-of-work in this case. I use whatever is possible. I had sites/products were no real ratings existed so we left them out. Faking reviews or ratings should be avoided. Google will find out about those sneaky tricks. They did in the past, the will in the future. The star ratings are a fantasic CTR booster. Combined with some more on-page work in title and description you can boost the results even more. When there are real reviews for a product then test it. Take one product, add the review(s) and check the results every 2 days for at least 6 weeks. A little side-note: changing existing pages and adding JSON-LD can bring your results down for a short period of time. At least did we notice these changes with some projects. Since then we update only small chunks of product pages at a time. Within 4 weeks those sites sometimes drop 3 to 10 places but come back much stronger and stay. Google Business and Reviews ... I guess you think of Search Console by Google. There are tools in it that help Google and your site with Rich data. Google Business can help you with things like Local SEO, Social SEO and citations. If you or your client can see a good amount of Branded queries you shouldn't only consider Google Business you have to take care of that.1 point
-
It is neither built-in nor is it a field - it is just a custom property that you are setting to a page object while it is in memory. You can name the property anything you like - it doesn't need to be named "custom_sort". The "custom_sort" is not saved to the database for any page - it only exists while the page is in memory, and it's purpose is simply to provide some property to use the sort() method on. Then once the PageArray is sorted on that property and saved to the Page Reference field the sort is retained as part of the Page Reference field value. If you just give it a go it will probably start to make more sense.1 point
-
My opinion on JSON-LD markup is the total opposite. It works really well for my (testing) sites and for clients. By now we talk about 30+ sites so finding are quite solid in my opion. There are a few things I noticed when working with JSON-LD or any other kind of meta-data/rich-snippets. Organization Implementation: easy Results: may vary Finding: better results when used together with Google Business and when there is a good amount of BRANDED queries Product Implementation: medium Results: Rich snippets in search results with pricings, stock infos, much higher CTR Finding: takes up to a week for the first results to show up Review Implementation: medium Results: rich snippets like Product but with additional rating stars, CTR even slightly better Finding: takes up to a week for the first results to show up Breadcrumbs Implementation: easy Results: may vary - larger sites benefit from it way better than small sites and one-pager Finding: don't try to trick Google - use the same data as on the page (same title, same url, same everything) otherwise pages can drop or can disappear Site search Implementation: easy Results: may vary when sites are too small Finding: the bigger the site, the more products it containts, the more "BRAND PRODUCT/CONTENT" queries Google notices the more likely Google will place a site search in search results - working example: https://www.otto.de/ (not one of my clients) Article Implementation: easy Results: may vary Finding: works well for recent news, breaking news - not so working well on old or outdated posts and small blogs/sites. Recipes Implementation: medium Results: huge snippets, high CTR Finding: you should be one of the very first with that recipe otherwise your snippet will not show up Events Implementation: medium Results: may vary in many ways - sometimes you get a nice event list under your site, sometimes your events show up for totally different queries that belong some how to your event (listed on event sites or for that very special location) Finding: it's a good idea to create JSON-LD for events as the results can spread across the web for all kinds of search queries - perfect for events you want to see everywhere on not just for your site/your brand.1 point
-
Are you using something like Bootstrap, Foundation or UIKIT in your markup? Is there any JS magic happening that interferes with the modal (same classes, IDs)? Try your markup without any of your CSS and JS please. Right now I have no further ideas what may cause this behaviour.1 point
-
Version 2.0.0 is finally here and supports ProcessWire 3! Release post: https://gregorlove.com/2018/05/webmention-for-processwire-update/ Modules directory: https://modules.processwire.com/modules/webmention/ Update to support ProcessWire 3.x Update php-mf2 library to version 0.4.x Improve verification of source linking to target Fix delete webmention bug Fix webmention author display in admin Fix WebmentionList render() method If you're still on ProcessWire 2, you're not forgotten. :] Check the release post for more details. As usual, if you are using this plugin I would love to hear from you. Feel free to send webmentions to the release post linked above.1 point
-
Yes. Yes it is tbh, in reality some people actually do not realize at first glance where they can jump to another section easily (no matter what screen size or device). I'm working at a company that has its strong roots in UX. We have our own lab and do usability-tests on a regular basis, since 18 years. We usually work with Axure prototypes. This way, we can find out early in the whole project stage if a certain concept or design works or doesn't. And from what I've heard, the hamburger menu indeed was not being recognized and has been often overlooked in that time-frame the first article in this thread was written. But as always in our industry (or life): it's "live and learn"... btw: I came across a nice tutorial how to build a top/tab/main-menu which uses the "more" approach, as screen size gets more narrow. I like this approach a lot. https://css-tricks.com/container-adapting-tabs-with-more-button/1 point
-
It cannot hurt for sure (that is why I also put it there whenever I can) but on small mobile viewports it might be problematic to also use the word "menu", however if the hamburger menu is prominent then people will find and use it as they have gotten used to it by now. Sure, there are alternatives but I do not think the hamburger icon is that bad and the alternatives are not better either. It just depends on the design context what works best. It is funny that in the "5 smart alternatives to the hamburger menu" article the hamburger icons are still used.1 point
-
Hello @MarcoPLY, I am glad this post helped you. JSON-LD is the recommended format for structured data. JSON-LD is JSON for Linked Data. Adding structured data with JSON-LD inside <body> is still valid, but usually it is placed inside <head> for better separation. Most of search engine specific code goes inside <head>. You could try the jsonld.js preprocessor, but I think it would be easier just to use PHP, since that is the easiest way to get data from ProcessWire. As far as I know is Google Tag Manager a different tool. Google Tag Manager is great for example online shops, where you want to track the customer experience. It seems to be an analytics tool for internal analytics, but has probably no effect on search results. But I have never used Google tag manager, just watched a few videos, so I could be wrong. Hello @dragan, Breadrcumbs has worked for me, although it is not very useful on websites with only one parent-page. ? Searchbox, Organization and Article hasn't worked for me. ? I don't think they will neglect structured data, but the support seems to be lacking. On Google I/O 2017 for example they announced upgrades to the Structured Data Testing Tool, but the upgrade doesn't seem to be available yet. In my opinion I am not that convinced of structured data compared to the time I have wrote this post. The extra effort is not that time consuming, but the results are a little bit disappointing. So I can totally understand if you don't want to bother with it. ? Regards, Andreas1 point
-
1 point
-
If you're using https://github.com/heiseonline/shariff you should be on the safe side (this plugin exists since 4 years now)1 point
-
1 point
-
The last time someone said "The hamburger menu doesn’t work" we tested onpage CTR and... almost no difference at all. It's by far not the best solution but people know it for a long time now. They see it regularly and can handle it. The article was first written in 2015 (according to the WP image path) and therefore things have changed since then. Remember all the "people don't read online!" or "people don't scoll!" statements.1 point
-
Guys, I guess Sandra Morgan's post is spam. It includes a link not to a checklist but a service, most probably their own...1 point
-
As the topic title says I want to share an idea I came up today: Why not track my module installations via Google Analytics? Very simple one, but huge potential and maybe somebody else has not thought of this possibility yet. It can also be used to track sent emails, submitted forms, log errors, whatsoever... $http = new WireHttp(); $http->post('http://www.google-analytics.com/collect', [ // Make sure to use HTTP, not HTTPS! 'v' => 1, // Version 'tid' => 'your-tracking-id', // Tracking ID / Property ID. 'cid' => 555, // Anonymous Client ID. 't' => 'event', // hit type 'ec' => 'myEventCategory', // category 'ea' => 'myEventAction', // action 'el' => 'myEventLabel', // label ]); You can test your setup here: https://ga-dev-tools.appspot.com/hit-builder/ Happy tracking1 point
-
@bernhard, you are of course free to put whatever you like into your modules. However, having your modules "phone home" like this discloses data that users may not want shared. At the minimum the website URL is disclosed. Not every site that exists on the internet is intended for public access. There are things like staging servers, and probably a whole range of other sensitive sites. My personal opinion is: 1. I think there should be a very clear and prominent statement so that users know that the module will send data to a third party, and what data will be sent. And I'm not sure that only a notice in the module readme would be satisfactory because users might download via the PW admin without seeing the readme. And if you start adding this to existing modules that didn't have it before it could pass by unnoticed when the module is updated. Basically there needs to be informed consent before data is sent, and probably also a privacy policy. 2. I think this crosses a line that shouldn't be crossed, and sets a dangerous precedent that if followed by others could be harmful to the PW project/ecosystem. There is a huge amount of trust placed in third-party modules by users. Modules can potentially access any website data. The very notion that a module phones home erodes trust. We don't want to create a sense of unease where every time a user contemplates installing a module they feel like they ought to comb through the source code to see what the module might be disclosing to a third party. In the bigger picture, I'd like to see PW get a reputation as being a system suitable for large institutional and government clients. Here in New Zealand, SilverStripe is in the enviable position of being seen as the go-to system for government websites. I think PW should be competing in this space. But government and institutional clients won't touch PW with a pole if there is a perception that there are privacy issues with modules in the PW ecosystem. I think the right way to track software popularity is by counting downloads, not phoning home. Sadly GitHub and GitLab don't provide useful tools for this, but that is another discussion.1 point
-
This might have something to do with the fact that ProcessWire by default block access to files in the templates directory. @BitPoet pointed this out here: You might need to move this files etc outside the template directory. However, I have not gone through ALL the code yet as there is a ton. I'll keep digging through it. Someone please correct me if I am wrong, as I have not worked much with assets that dont run through the processwire environment.1 point
-
@Ivan Gretsky, if you have Imagick installed you could use this function I wrote a while back for easy ImageMagick effects: It does quite a nice blur. But now that supporting IE is less of an issue you could also try a CSS filter.1 point
-
Hi @Ivan Gretsky, thanks for the nice words. To make an image overblurred, there is only the "blur" and the "smooth" functions. But maybe you can experiment with using "pixelate" before "smooth"? pixelate(2) or pixelate(3) and then smooth(255), (regarding your desription, maybe 2-3 times smooth(255)) Or isn't that what you are asking for?1 point
-
Macrura - very cool - I hadn't thought of using it that way and will actually need similar buttons in an upcoming project so might just consider using this module to do it! The trouble I am having with PW lately is that there are so many great new ways of doing things and it's hard to keep track of them all1 point
-
Disclaimer This is not a step by step tutorial, but the script posted serves as an example of how easy it is to bootstrap ProcessWire(PW), query an external API (in this case, Strava) and import stuff into PW pages using the PW API. To the import! So i wanted a quick, easy and automated way to import someones Strava activities into his/her own 'activity feed' on a certain PW website. Strava has an API which you can use to -amongst other things- get your own activity data. After setting up my Strava app i had access to the API. Next step was to import the JSON data i wanted into PW pages. This was as easy as creating a PW bootstrapped script (see code below) and using the PW API to import the data into Pages. For convenience in talking to the Strava API i used a library that is available on Github. To keep track of what was happening i decided it would be nice to log the import results to a log file. Luckily, PW had me covered by using the WireLog class (/wire/core/WireLog.php). Result With some googling on Strava and a (very) basic knowledge of PHP and the PW API i was able to get things working in no-time. With no other CMS i've worked with -and i've had dealings with quite a few- it would have been so easy to get the desired result. Some notes about the script: PW version used: 2.4.12, but should work in earlier versions as well. It does not create templates, fields and pages for you. If you would want to use it (maybe as a starting point), create templates, fields and pages for your own needs and adjust the script accordingly. Also remember to adjust script paths. In the posted example i don't do any sanitizing on the Strava data. You maybe should In production you would maybe call these kind of importers via a cronjob, and make it non-accessible from the outside. It served my purposes. There might be better ways of handling this stuff. All suggestions and/or questions are welcome. In this case the script was/is called importer_strava.php , located at mydomain/importer/importer_strava.php and requested manually. See notes above, number 3. <?php /** * Strava Importer * * This crude script will import your own Strava activities into newly created * PW pages under a given parent page. The import result will be logged in: * /site/assets/logs/importer_strava.txt, using the WireLog class. * * For this to work you first need to create an app via http://www.strava.com/developers * Strava API reference: http://strava.github.io/api/ * * The PHP library used for working with the Strava v3 API can be found at: * https://github.com/iamstuartwilson/strava * */ // Bootstrap Processwire include __DIR__ . '/../index.php'; // Include the PHP Library for working with the Strava v3 API include __DIR__ . '/StravaApi.php'; // Strava credentials (you can get these from the Strava app page you've created) $clientId = "Your clientId"; $clientSecret = "Your clientSecret"; $accessToken = "Your accessToken"; // Connect to Strava $api = new StravaApi( $clientId, $clientSecret ); // Set the parent where activities will be stored as child pages $activity_parent = wire('pages')->get("/activities/"); // Get new activities $results = $api->get( 'athlete/activities', $accessToken, array( 'after' => $activity_parent->strava_last_checked ) ); // Uncomment if you want to inspect the $results response onscreen // echo "<pre>"; // print_r($results); // echo "</pre>"; // Import new Strava activities to PW Pages if (empty($results)) { // Log that no activities have been imported $text = "No new activities have been imported"; $options = array('showUser' => false, 'showPage' => false); wire('log')->save('importer_strava', $text, $options); } else { $numImportedPages = 0; // Start counter for number of imported pages foreach ($results as $result) { $p = new Page(); // Create new page object $p->template = 'activity'; // Set template $p->parent = $activity_parent; // Set the parent // Assign $result data to the corresponding Page fields $p->name = $result->id; $p->title = $result->name; $p->act_distance = $result->distance; $p->act_moving_time = $result->moving_time; $p->act_elapsed_time = $result->elapsed_time; $p->act_total_elevation_gain = $result->total_elevation_gain; $p->act_type = $result->type; $p->act_start_date = substr($result->start_date_local, 0, 10); $p->act_average_speed = $result->average_speed; $p->act_start_lat = $result->start_latlng[0]; $p->act_start_long = $result->start_latlng[1]; $p->act_end_lat = $result->end_latlng[0]; $p->act_end_long = $result->end_latlng[1]; $map = $result->map; $p->act_map_polyline = $map->summary_polyline; $p->save(); // Save the Page object $numImportedPages++; // Increment counter } // Log the number of activities that have been imported $text = ($numImportedPages == 1) ? "$numImportedPages new activity imported" : "$numImportedPages new activities imported"; $options = array('showUser' => false, 'showPage' => false); wire('log')->save('importer_strava', $text, $options); // After the import, update Field 'strava_last_checked' to current Unix timestamp // This could also be placed outside of the 'else' to update on each script run $timestamp = $activity_parent; $timestamp->of(false); // Turn off output formatting before saving things $timestamp->strava_last_checked = time(); $timestamp->save('strava_last_checked'); }1 point