Leaderboard
Popular Content
Showing content with the highest reputation on 05/11/2016 in all areas
-
I've just added a pull request for a ProcessWire driver to laravel valet: https://github.com/laravel/valet/pull/55/files For anyone wanting to have a quick local dev environment (on a mac) you should certainly take a look. https://laravel.com/docs/master/valet4 points
-
The modules does save timestamps of the last execution for each of it's hookable timeframes (site/assets/cache/LazyCron.cache). For each page-request it checks each timestamp if it's bygone by more than the corresponding timeframe and if so it triggers the function and updates the timeframe. Therefore the hook will always run if the last execution was anytime longer ago than the timeframe's timespan itself. As this does depend on actual page views this cannot be timed to a specific time of the day or alike, e.g. everyDay could be: 24h gap, 26h gap, 25,5h gap, 24h gap, 48h gap (nobody visited the second day).4 points
-
I don't think the "B" and the "I" icons are meant to represent <b> and <i> HTML tags - they are likely carry-overs from the icons used in word processors. As far as I know pretty much all WYSIWYG editors insert <strong> and <em> tags for these buttons. The CKEditor docs confirm the Format dropdown is only for block-level elements so that's what's probably crashing it.4 points
-
The Content-Transfer-Encoding of 7bit isn't compatible with utf8 (or any other non-US-ASCII charset), but unfortunately it is hardcoded in WireMail.php. When mail clients encounter this header and find characters above ASCII code 127, it is anybody's guess how they interpret them. This should IMHO be fixed directly in the WireMail class' send method. A quick-n-easy approach would be to look for individual characters outside the 0-127 range and, if such is present, set Content-Transfer-Encoding to base64 and use encode_base64 on the part in question.3 points
-
I was hoping for something more like Lister (rows, columns, sorting) but with thumbnails. It just seems like information is being obscured in order to have a more front-end kind of design. Casting my vote for... A way to see all the image filenames clearly, not truncated and supered over an image. A way to see how they are tagged & described without having to drill into each one. Thumbnails with same aspect ratio as the original image (cropped to square is the visual equivalent of all caps)3 points
-
New site for SteynStudio using bb-starter, AIOM, Batcher, image crop, Textarea Counter, Site-wide File Manager.2 points
-
Yes, such sites look/feel nice, provided you have a capable internet connection and a fast computer. Otoh they are usually a nightmare from usability point of view not to mention the complexity the developer faces I sometimes add a small parallax but even the smallest one requires much extra work. Recently I saw this site that catched my eyes: http://moto.oakley.com/ Ps. it's heavily animated!2 points
-
That is why I was pointing to the new Variations list as a starting point, which already has thumbnails and some basic info we need. Sure, it would need additional features others have already described above, but just one more: the columns visible might be customizable, so we can fine tune the list to our needs. True, the possibilities are endless, and we should figure out what tools are really missing in the current state. After all, system design precedes implementation2 points
-
As I said it depends on the timestamp in the LazyCron.cache file. This does determine when the everyDay hook is triggered (e.g. all everyDay hooks at once). If you're using a cron anyways I'd rather suggest not using LazyCron at all in that case. It's nice if you just want to ensure LazyCron to run, but if you want it to run at the cron execution just let it run 'php /some/path/cron.php' with this: <?php // cron.php include 'index.php'; //Trigger anything needed2 points
-
For my CKEditor fields the "B" (Bold) button does apply the strong tag. I think the Format dropdown is for block-level elements.2 points
-
I believe those IDs are collected in a visited array in $session and he will pull it from there with implode("|", $visitedCollection).2 points
-
Hi, Or you can just simply Password Protect with htaccess: http://www.htaccesstools.com/articles/password-protection/2 points
-
Thanks - I have made those changes. I also upped the size of the icons a couple of pixels which should also help a little. I played around with adding a legend to the panel, but it just kind of looked messy and took up too much extra space, so I just added tooltips to the icons - hopefully this helps a little.2 points
-
2 points
-
One more: Loop pages in ProcessWire without building a $pageArray. This is useful for when a find() would return too many results to keep in memory. $selector = "template=pages_template"; // as an example while (1) { $p = wire('pages')->get("{$selector}, id>$id"); // get page with id bigger than previous if(!$id = $p->id) break; // assign current page's id to $id or break the loop if it doesn't exist // do stuff using $p as the current page wire('pages')->uncacheAll(); }; This served me well when I had to modify thousands of pages in one go. Works great with bootstrapping from the terminal because it doesn't affect the viewing of the website.2 points
-
Fieldtype and Inputfield ImageMarker As of 02 January 2018 ProcessWire versions earlier than 3.x are not supported Version: Stable Project Page: Github Modules Directory: http://mods.pw/Bk OR http://modules.processwire.com/modules/fieldtype-image-marker/ Requires: ProcessWire 2.4 or greater ######################## About This module allows you to easily 'place markers' on an image. Each placed marker's position/coordinates (x and y) are saved in the field as well as the ID of the ProcessWire page the marker refers to. In the backend markers are placed on a specified base image. In the frontend, using each saved page ID you can then retrieve any information you want about the pages being referenced and display that on your website over the same base image you used in the backend. The module is useful for a diverse number of uses including: Product demonstration: place markers on various parts of your product to showcase its features. Using a bit of CSS and/or JavaScript you can create pop-up boxes displaying more information about that feature of the product. The information (in this case, feature), would be information you've stored in some field (e.g. a text field) in the page marker (i.e. the page being referenced by the coordinates). Office locations: place markers on a map showing global offices of a multinational company Points-of-Interest: place markers showing points of interest on a map or location or anything. The coordinates are saved as percentages. This means they will scale well with the image being marked. This module came about as a result of this request. @credits Ryan Cramer: This code borrows from his FieldtypeEvents. @credits Helder Cervantes: Module concept, HTML, CSS, JavaScript. @credits Roland Toth: CSS, Inspiration. API In the frontend, the field returns an array of ImageMarker objects. Each of these has the following properties info (integer): The page ID of the marker (i.e. the page being referenced by the marker. Using this, you can get the referenced page and have access to all its data. infoLabel (String): The title of the page (above) referenced by the marker (runtime only). x (Integer): The x-coordinate of the marker (%). y (Integer): The y-coordinate of the marker (%). You grab the properties as in any other PW field, e.g. $out = '<img src="'. $page->base_image->url . '" alt="">';// image to place markers on 'base_image' is the name of the file field foreach ($page->marker as $m) { // do something with the following properties $m->id;// e.g. $pages->get((int) $m->id); $m->x; $m->y; $m->infoLabel; } // the CSS and HTML are up to you but see InputfieldImageMarker.module for examples Frontend implementation is left to you the developer/designer1 point
-
MediaLibrary Update: MediaLibrary can now be found in the official module list. Out of necessity, I've started to implement a simple media library module. The basic mechanism is that it adds a MediaLibrary template with file and image fields. Pages of this type can be added anywhere in the page tree. The link and image pickers in CKEditor are extended to allow quick selection of library pages from dropdowns. In the link picker this happens in the MediaLibrary tab, where you can also see a preview of the selected image. In the image picker, simply select a library from the dropdown at the top, everything else is handled by standard functionality. I've put the code onto github. This module is compatible with ProcessWire 3. Steps to usage: Download the module's zip from github (switch to the pw3 branche beforehand if you want to test on PW 3.x) and unpack it into site/modules Click "Modules" -> "Refresh" in the admin Click "Install" for MediaLibrary For testing, create a page with the MediaLibrary template under home (give it an expressive title like 'Global Media') and add some images and files Edit a differnt page with a CKEditor field and add a link and an image to see the MediaLibrary features in action (see the screencap for details) Optionally, go into the module settings for MediaLibrary Note: this module is far from being as elaborate as Kongondo's Media Manager (and doesn't plan to be). If you need a feature-rich solution for integrated media management, give it a look. Feel free to change the settings for MediaFiles and MediaImages fields, just keep the type as multiple. There are some not-so-pretty hacks for creating and inserting the correct markup, which could probably be changed to use standard input fields, though I'm a bit at a loss right now how to get it to work. I've also still got to take a look at error handling before I can call it fit for production. All feedback and pointers are appreciated (that's also why I post this in the development section). Edit 09.03.2016 / version 0.0.4: there's now also a "Media" admin page with a shortcut to quickly add a new library. Edit 01.05.2016: Version 0.0.8: - The module now supports nested media libraries (all descendants of eligible media libraries are also selectable in link/image picker). - There's a MediaLibrary::getPageMediaLibraries method you can hook after to modify the array of available libraries. - You can switch between (default) select dropdowns or radio boxes in the module configuration of MediaLIbrary to choose libraries. Edit 10.10.2018: Version 0.1.3: - Dropped compatibility for ProcessWire legacy versions by adding namespaces - Allow deletion of libraries from the Media overview admin page - Added an option to hide media libraries from the page tree (optionally also for superusers)1 point
-
FieldtypeRuntimeMarkup and InputfieldRuntimeMarkup Modules Directory: http://modules.processwire.com/modules/fieldtype-runtime-markup/ GitHub: https://github.com/kongondo/FieldtypeRuntimeMarkup As of 11 May 2019 ProcessWire versions earlier than 3.x are not supported This module allows for custom markup to be dynamically (PHP) generated and output within a page's edit screen (in Admin). The value for the fieldtype is generated at runtime. No data is saved in the database. The accompanying InputfieldRuntimeMarkup is only used to render/display the markup in the page edit screen. The field's value is accessible from the ProcessWire API in the frontend like any other field, i.e. it has access to $page and $pages. The module was commissioned/sponsored by @Valan. Although there's certainly other ways to achieve what this module does, it offers a dynamic and flexible alternative to generating your own markup in a page's edit screen whilst also allowing access to that markup in the frontend. Thanks Valan! Warning/Consideration Although access to ProcessWire's Fields' admin pages is only available to Superusers, this Fieldtype will evaluate and run the custom PHP Code entered and saved in the field's settings (Details tab). Utmost care should therefore be taken in making sure your code does not perform any CRUD operations!! (unless of course that's intentional) The value for this fieldtype is generated at runtime and thus no data is stored in the database. This means that you cannot directly query a RuntimeMarkup field from $pages->find(). Usage and API Backend Enter your custom PHP snippet in the Details tab of your field (it is RECOMMENDED though that you use wireRenderFile() instead. See example below). Your code can be as simple or as complicated as you want as long as in the end you return a value that is not an array or an object or anything other than a string/integer. FieldtypeRuntimeMarkup has access to $page (the current page being edited/viewed) and $pages. A very simple example. return 'Hello'; Simple example. return $page->title; Simple example with markup. return '<h2>' . $page->title . '</h2>'; Another simple example with markup. $out = '<h1>hello '; $out .= $page->title; $out .= '</h1>'; return $out; A more advanced example. $p = $pages->get('/about-us/')->child('sort=random'); return '<p>' . $p->title . '</p>'; An even more complex example. $str =''; if($page->name == 'about-us') { $p = $page->children->last(); $str = "<h2><a href='{$p->url}'>{$p->title}</a></h2>"; } else { $str = "<h2><a href='{$page->url}'>{$page->title}</a></h2>"; } return $str; Rather than type your code directly in the Details tab of the field, it is highly recommended that you placed all your code in an external file and call that file using the core wireRenderFile() method. Taking this approach means you will be able to edit your code in your favourite text editor. It also means you will be able to type more text without having to scroll. Editing the file is also easier than editing the field. To use this approach, simply do: return wireRenderFile('name-of-file');// file will be in /site/templates/ If using ProcessWire 3.x, you will need to use namespace as follows: return ProcessWire\wireRenderFile('name-of-file'); How to access the value of RuntimeMarkup in the frontend (our field is called 'runtime_markup') Access the field on the current page (just like any other field) echo $page->runtime_markup; Access the field on another page echo $pages->get('/about-us/')->runtime_markup; Screenshots Backend Frontend1 point
-
My first stop is always the Network tab of my dev console - there is probably an error from the ajax request that will appear there.1 point
-
They are separate images: <div class="sequence-container" data-anchor-target="#adaptable" style="z-index: -1;"> <img class="lazy skrollable unrendered " src="images/sequence2-final/WEB_AMX_shot002_00008.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00008.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-820-top="display:block;" data-775-top="display:none;" style="display: none;"> <img class="lazy skrollable unrendered " src="images/sequence2-final/WEB_AMX_shot002_00010.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00010.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-776-top="display:block;" data-725-top="display:none;" style="display: none;"> <img class="lazy skrollable unrendered " src="images/sequence2-final/WEB_AMX_shot002_00012.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00012.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-726-top="display:block;" data-675-top="display:none;" style="display: none;"> <img class="lazy skrollable unrendered " src="images/sequence2-final/WEB_AMX_shot002_00014.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00014.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-676-top="display:block;" data-625-top="display:none;" style="display: none;"> <img class="lazy skrollable unrendered " src="images/sequence2-final/WEB_AMX_shot002_00016.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00016.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-626-top="display:block;" data-575-top="display:none;" style="display: none;"> <img class="lazy skrollable unrendered " src="images/sequence2-final/WEB_AMX_shot002_00018.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00018.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-576-top="display:block;" data-525-top="display:none;" style="display: none;"> <img class="lazy skrollable unrendered " src="images/sequence2-final/WEB_AMX_shot002_00020.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00020.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-526-top="display:block;" data-475-top="display:none;" style="display: none;"> <img class="lazy skrollable unrendered " src="images/sequence2-final/WEB_AMX_shot002_00022.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00022.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-476-top="display:block;" data-425-top="display:none;" style="display: none;"> <img class="lazy skrollable unrendered " src="images/sequence2-final/WEB_AMX_shot002_00024.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00024.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-426-top="display:block;" data-375-top="display:none;" style="display: none;"> <img class="lazy skrollable unrendered " src="images/sequence2-final/WEB_AMX_shot002_00026.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00026.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-376-top="display:block;" data-325-top="display:none;" style="display: none;"> <img class="lazy skrollable unrendered " src="images/sequence2-final/WEB_AMX_shot002_00028.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00028.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-326-top="display:block;" data-275-top="display:none;" style="display: none;"> <img class="lazy skrollable unrendered " src="images/sequence2-final/WEB_AMX_shot002_00030.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00030.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-276-top="display:block;" data-225-top="display:none;" style="display: none;"> <img class="lazy skrollable unrendered " src="images/sequence2-final/WEB_AMX_shot002_00032.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00032.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-226-top="display:block;" data-175-top="display:none;" style="display: none;"> <img class="lazy skrollable unrendered " src="images/sequence2-final/WEB_AMX_shot002_00034.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00034.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-176-top="display:block;" data-125-top="display:none;" style="display: none;"> <img class="lazy skrollable unrendered " src="images/sequence2-final/WEB_AMX_shot002_00036.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00036.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-126-top="display:block;" data-75-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00038.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00038.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data-76-top="display:block;" data--200-top="display:none;" style="display: block;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00041.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00041.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--199-top="display:block;" data--225-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00045.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00045.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--224-top="display:block;" data--275-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00049.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00049.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--274-top="display:block;" data--325-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00053.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00053.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--324-top="display:block;" data--375-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00057.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00057.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--374-top="display:block;" data--425-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00061.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00061.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--424-top="display:block;" data--475-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00065.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00065.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--474-top="display:block;" data--525-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00069.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00069.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--524-top="display:block;" data--600-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00073.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00073.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--599-top="display:block;" data--650-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00079.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00079.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--649-top="display:block;" data--700-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00083.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00083.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--699-top="display:block;" data--750-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00087.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00087.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--749-top="display:block;" data--800-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00091.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00091.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--799-top="display:block;" data--850-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00095.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00095.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--849-top="display:block;" data--900-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00099.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00099.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--899-top="display:block;" data--950-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00103.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00103.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--949-top="display:block;" data--1000-top="display:none;" style="display: none;"> <img class="lazy skrollable rendered " src="images/sequence2-final/WEB_AMX_shot002_00105.jpg" data-original="images/sequence2-final/WEB_AMX_shot002_00105.jpg" alt="" data-anchor-target="#adaptable" data-2000-top="display:none;" data--999-top="display:block;" style="display: none;"> </div> The fan in my 2011 Macbook Pro goes crazy visiting both of these sites and the page scrolling is very laggy!1 point
-
Thanks - I changed them to be close to what you suggested. The latest version also add the generation times for each panel to the selector panel so you can quickly see if one is very slow. I have also included some CSS tweaks and some other small bug fixes that I discovered with the validator and users panel.1 point
-
Probably the best example out there: https://gist.github.com/somatonic/52333381 point
-
You shouldn't use the assets path of the page as upload destination. Create a temp. folder with wireTempDir() to upload files to. They'll be automatically moved to the correct location when being added to the page's file field.1 point
-
Check also if the limitation is not on the FB API side. I remember that I had to do the same with youtube, but YT allowed me to call a limited amount of videos on the same request.1 point
-
I guess i have my answer then. Thank you for your help.1 point
-
Same is happening here, I've just tried with one of my installation. Cannot find a solution right now, but that's interesting.1 point
-
Hi. I switched to PW from Seblod. In seblod we have field called "Field group". This field just group some fields to logical group. I think it's quite useful feature. For example: in almost all templates i have fields for SEO like title, description, index etc. ( seven fields ). In current PW workflow ( as i know ) i have to go to every field and set needed templates for it or go to every template and set needed fields. It's quite sadly If we could to have some sort of group field it became easily. Just put one field to every template. Maybe i miss something and this field is already in PW?1 point
-
1 point
-
Hi, I have just checked it out. May I suggest changes to the <title>s? Default panel from module config settings to something like: turned on in module's settings "config settings" is sort of word repetition, PW labels the buttons in question "Settings" so it maybe enough. I also tried to use the same point of view in the case of both titles: why one option is turned on or off, so the messages are consistent. Panel status changed once to something like: turned on "Once" or maybe: turned on by "Once" ? I also tried to be short The enlarged icons are a bit easier to recognize and probably about the largest in size we can use. Thank you!1 point
-
aaah, I sort of understood that they didn't want to use $session... ...1 point
-
Update: Version 008 Changelog Fixed a couple of minor bugs, thanks @adrian for reporting +++++++++ @adrian, Haven't seen or heard of that 'infinity' error before. Were you testing on PW 3.X btw?1 point
-
Hey Kongondo, Thanks for this - using it for the first time - very handy! Just a couple of warnings that I noticed appear in the admin until you have entered data: I also noticed that sometimes the co-ordinates weren't being populated properly - just showing "Infinity". I had to save the page again, then the next time I moved the markers, they worked correctly. I don't unfortunately have a reliable way to reproduce, but just wanted to let you know in case you can easily track it down.1 point
-
I think the new Images field is really nice. Beautifully designed and miles ahead of the old images field. I have to admit though. I really miss a list view. I'm not saying I miss the old list view but I think a list view is needed. Right now I'm working on several galleries of images with many similar images (cropped and non cropped) It's not practical with several images to hunt around via tool-tip for the image information. With a list view, I can see what I want instantly.1 point
-
Following up on the idea of some tool to do this, take a look at the module attached to this post: https://processwire.com/talk/topic/8406-set-multiple-templates-role-access/?p=81711 It will let you add selected fields to selected templates.1 point
-
I think there is still an outstanding bug (https://github.com/ryancramerdesign/ProcessWire/issues/1803) with images on user pages - it seems like outputformatting is always off which results in the need for first(), even when maxFiles is set to 1. Try this: $user_image->first()->url1 point
-
There shouldn't be any difference as both are essentially the same. find() does internally create a new PageArray anyways.1 point
-
1 point
-
That's the jQueryDataTable plugin loaded in PW for easy use, so not every module that needs jQueryDataTable would have to include it. What you wanted was this earlier ajax implementation in PW I did before that: http://modules.processwire.com/modules/data-table/1 point
-
I wouldn't touch that if I were you. No need to. ProcessWire already has got you covered. You could probably get away with less than 10 lines of code..Something as simple as...OK...before that, let's break this down. Server-side processing: is probably easier than client-side processing. The former is easier (IMO), because PW has got you covered...Throw some PW API in your template file and you are sorted. You only need to send back data in the format requested by the client, in this case DataTables is the client. Client-side: would have been a bit more difficult (for me...because I find PHP easier than JavaScript ). However, in this particular case, we are covered. DataTables does all the heavy lifting. All we need to do is to give it data in the format and structure it has requested. Requesting data: First, the JavaScript needed to request data (i.e. the client requesting data from the server)..Straight from the DataTables example $(document).ready(function() { $('#example').DataTable( {// the ID of your HTML table "processing": true, "serverSide": true, "ajax": "scripts/server_processing.php"// this is the only thing to change RE ProcessWire(template file) } ); } ); Nothing fancy in that code. The value passed to the ajax property is the important thing here. In ProcessWire, we won't be able to access a PHP file directly like that (see forum posts about this). We have two choices. Either, post to self (./) - notice the dot, or post to an existing PW page. So... $(document).ready(function() { $('#example').DataTable( { "processing": true, "serverSide": true, "ajax": "./"// posting to self (i.e. the current page) //"ajax": "/ajax-handler/"// posting to a ProcessWire page titled Ajax Handler that lives off the root } ); } ); Process ajax request: In the template file of the 'page' or the 'ajax-handler' page, depending on the value set to 'ajax' in the JS above, you will have code like so, ready to receive ajax requests..@see if($config->ajax) { // here we are listening to ajax requests sent to this page /* 1. listen (could be POST or GET. in the DataTables example, it is using GET 2. Check and sanitize required parameters 3. Kosher? Send back data in the format requested, i.e. JSON. Otherwise, ignore, show error or tell them to take a hike */ } // output HTML as usual => e.g. @see the HTML tab in the DataTables SSP example OK, the fun part. Fire-up Firebug and go to the 'Console' Tab. Visit the DataTables SSP page and watch the Console. Have a look at: Params tab: DataTables has sent a long request. Most of the stuff we will not need. The key here is to match the parameters to their corresponding ProcessWire terms, i.e. limit, sort and start. That's all we need. This is basically pagination. So, let's match stuff we need for pagination... DT => PW start => start length => limit sort // @note: index-based naming, where 0=first DataTables table column. // In this case, the value is 5 (i.e. the last column in the SSP example = salary) order[0][column] 5 => sort (sort will correspond to whatever property in your selector, e.g. title, some_text_field, etc) order[0][dir] asc => sort order in ProcessWire. if asc, do nothing, if desc then sort becomes -sort So, we get our data as normal in ProcessWire. Note, this code goes within the if($config->ajax){} condition... // @note: here you sanitize inputs + could do some other logic, e.g. check if input present, etc $start = (int) $input->get->start; $limit = (int) $input->get->length; $sort = $sanitizer->name(?)// @this is your homework; how to get to the order[0][column] and order[0][dir] values. ;-) {dir here is direction, btw} $data = $pages->find("template=basic-page, start=$start, limit=$limit, sort=$sort"); if(count($data)) // { // need to send back data with some extras to DataTables // @hint: have a look at the structure of the JSON. // @continued below... } else //error message, nothing found Next, have a look at either the 'Response' or 'JSON' tabs. That is what the server has sent back. The most important thing to note is that that was originally an array on the server (built from our $data above with some extras...). Let's build this next. if($config->ajax) { // @note: this is built from the $data above /* @note: as per the JSON tab in Firebug we need to send back 4 'things' to DataTables. 1. draw (int): I thought corresponds to the page number but seems to increment: I'll let you find out 2. recordsTotal: Number of records found 3. recordsFiltered: I haven't checked what this is 4. data: The ProcessWire find results */ // to get the total number of records: $total = $data->getTotal(); $dataDT = array();// we'll send this back to DataTables as JSON $data['draw'] = $whateverDrawIs;// could be $limit = $data->getLimit(); $data['recordsTotal'] = $total; $data['recordsFiltered'] = $whateverThisMeans; // prepare values to send back that match your DataTables table headers foreach ($data as $d) { $dataDT[] = array($d->title, $d->name, $d->id, $d->parent->title, $d->template->name);// each record } // send data back to client in JSON format (@see the JSON tab in Firebug) header("Content-type: application/json"); echo json_encode($dataDT); }// end if ajax And that's it Written quickly in browser, got carried away...there could be errors, blah blah, the usual disclaimers1 point
-
Just to add to Sebii's answer, see https://processwire.com/talk/topic/9813-copy-template-via-api/ You could create a template with your 'standard' fields and clone it as above for reuse and extension.1 point
-
A compatibility warning: After testing this with the new Croppable module (which is currently in beta and works with PW3 beta): https://processwire.com/talk/topic/8709-croppableimage/page-7#entry119754 Right now this SpringCleaning module treats crops as "variations" and resets then too! - This is not desired in most cases!1 point
-
I doubt it makes much (or any) difference in terms of performance but you can do the same a bit more briefly like this: $items = $page->children("sort=title"); $items->prepend($items->find("featured=1, sort=timeon"));1 point
-
Hi, for a very common task like SEO, it might be also worth to: 1) Make use of the fields import/export to share the set of SEO fields betweend pw installations 2) Add the SEO fields with a small custom script making use of the API An example of it can be found on processwire-recipes.com Greetings Edit: Link http://processwire-recipes.com/recipes/add-fields-to-template/ Edit2: Or actually just create the whole set of your SEO fields (+adding them to templates) in a reusable script1 point
-
You could do this in admin.php (above the line that brings in controller.php): $wire->addHookAfter('AdminTheme::getExtraMarkup', function($event) { $extras = $event->return; $extras['head'] .= '<link rel="shortcut icon" href="'.wire('config')->urls->templates.'favicon.png">'; $event->return = $extras; });1 point
-
Update: Version 007 Changelog As per the request by @heldercervantes , coordinates table can now be manually sorted.1 point
-
That's not possible in a single selector. Sort order can only be 'hierarchical' for the whole result set and not different for just a subset.1 point
-
Hey, you impatient PW users, here is a intermediate version for the current PW 3.0.17 devns branch. It is only available in the Github PW3-Tree. (you need to upload and install manually) Attention: Please first install the InputfieldRangeSlider module. It is required for the new version! The module now sits upon the new core Imagefield and provide a few more configsettings as the PW 2 version: disable enable the core image editor (default: disabled) should Imagenames be displayed by default (default: off) should Thumbnails be displayed complete, not a cropped square (default: off) style settings (color and transparency) for Thumbbackgrounds max char number for Imagebasenames (please adjust according to the length of your GridSize) (default: 15) globally disable the individual selection for Quality and Sharpening, instaed use the ImageSizerEngines defaults or define globally static defaults In the Inputfield itself, you are able to toggle displaying the Imagenames and how the Thumbnails are displayed: cover or contain. There is also a textinput for filtering by basenames. Screens:1 point
-
https://github.com/ryancramerdesign/ProcessWire/issues/1803 Will see what Ryan has to say.1 point
-
I am sure lots of very cool things could be done, all of which will require a little more than the 5 mins of planning and 20 mins of coding I put into this one Here is a revised version (with a new name) with about an extra 15 mins of coding that adds support for batch adding/removing of fields from templates. I think I might actually make use of this version quite a bit. EDIT: I don't think "Template Setup Batcher" is the right name - not really about setting up templates from scratch. Oh well - maybe change again if a newer version ever happens ProcessTemplateSetupBatcher.module1 point
-
It's one of the statuses you see in the top of the Pages class. So you can set the status using it like: $page->status = Page::statusUnpublished; Edit: Have you looked on the Cheatsheet? For reference under "Page Status" http://processwire.com/api/cheatsheet/ BTW aren't you the guy with the processwiresexy, whatever? I'm kinda surprised you didn't know this.1 point