Leaderboard
Popular Content
Showing content with the highest reputation on 08/18/2013 in all areas
-
One of the best compliments I can give ProcessWire/Ryan (and all the other amazing contributors) is that I no longer think about CMSs. I just think about making things - knowing that whatever I come up with will be possible with ProcessWire. Can ProcessWire do (x)? Yes, in several devastatingly simple ways. Everything else feels like a kludge when compared.4 points
-
3 points
-
3 points
-
here's how i setup the custom datatable page: 1.) make a folder in site/templates called admin-custom; inside that i have a css and js folder; in those folders i put all the scripts and stylesheets for datatable (dataTable.css, jquerydataTables.min.js, jquery.uniform.min.js); 2.) make a template in the templates folder, i called it admin-product-table.php; with this code: <table class="table table-bordered" id="dyntable"> <colgroup> <col class="con0" style="align: center; width: 4%" /> <col class="con1" /> <col class="con0" /> <col class="con1" /> <col class="con0" /> <col class="con1" /> <col class="con0" /> <col class="con1" /> </colgroup> <thead> <tr> <th class="head0 nosort"><input type="checkbox" class="checkall" /></th> <th class="head1">Parent Product</th> <th class="head0">Series</th> <th class="head1">Part #</th> <th class="head0">Room Cu. Ft.</th> <th class="head1">Price Ea.</th> <th class="head0">Missing</th> </tr> </thead> <?php $products = $pages->find('template=product-child,sort=title|series'); foreach ($products as $product) { ?> <tr class="gradeX"> <td class="aligncenter"><span class="center"><input type="checkbox" /></span></td> <td> <a href="<?php echo $config->urls->admin; ?>page/edit/?id=<?php echo $product->parent->id ?>" target="_blank"> <?php echo $product->parent->title ?> </a> </td> <td><?php if($product->product_series) {echo $product->product_series;} else {echo 'n/a';} ?></td> <td> <a href="<?php echo $config->urls->admin; ?>page/edit/?id=<?php echo $product->id ?>" target="_blank"> <?php echo $product->title ?> </a> </td> <td> <?php if($product->roomsize_min && $product->roomsize_max) {echo $product->roomsize_min . '-' . $product->roomsize_max;} else echo 'n/a'; ?> </td> <td class="price">$<?php echo $product->product_price; ?></td> <td> <?php if(!$product->speaker_sensitivity) { echo '<span style="color:lime">Sensitivity</span>'; } ?> </td> </tr> <?php } ?> </tbody> </table> <script> $(document).ready(function(){ // dynamic table if(jQuery('#dyntable').length > 0) { jQuery('#dyntable').dataTable({ "sPaginationType": "full_numbers", "aaSortingFixed": [[0,'asc']], "fnDrawCallback": function(oSettings) { jQuery.uniform.update(); } }); } }); </script> 3.) under the Admin page, create a child page called Products, uses template "admin-products" (which will need the ACP_scripts_and_styles field), and uses alternate template filename of admin. Paste the links to the scripts and stylesheets into the ACP_scripts_and_styles field: site/templates/admin-custom/css/dataTables.css site/templates/admin-custom/js/jquery.dataTables.min.js site/templates/admin-custom/js/jquery.uniform.min.js some of how you set this up will depend on which version of PW you are on – see the ACP documentation about that; in my case i have a child page of Products called Products Table which uses the admin-product-table template; hope that's not too confusing; it's pretty simple, but tricky to explain; most of it you can figure out from the ACP documentation..2 points
-
Just feeling the love today for this incredible system. As with most great things, you tend to take them for granted after a while but I just had a realisation today of just how important ProcessWire is to my working life and the thought of having to use any other tool is too depressing for words! Thanks once again Mr Cramer2 points
-
I also want to join the party Some of these I use a lot, some I just find interesting and bookmarked: http://copypastecharacter.com/ <- absolutely love it!! http://webanywhere.cs.washington.edu/ <- screen reader anywhere http://www.monstaftp.com/ <- this one is very recent, so I hope it will get better http://photobatch.stani.be/ <- for photo batch editing. website is not working right now, see here https://launchpad.net/phatch http://redpen.io/ <- very simple tool for getting feedback on designs https://draftin.com/ <- for collaborative writting. I love where they are going with this https://delicious.com/ with this chrome extension <- still use it a lot for public and private bookmarking http://codepen.io/ <-everyone knows this, right? http://color.hailpixel.com/ <- nice color picker http://tinypng.org/ <- make pngs smaller https://avocado.io/ <- for couples. use it everyday https://aerofs.com/ <- very fast file sharing http://www.justbeamit.com/ <- also for sharing files without an intermediary server https://www.hightail.com/ <- speaking of file sharing. Did you know that yousendit changed? http://www.adminer.org/ <- my favorite for managing mySQL https://code.google.com/p/sigil/ <- for making ebooks http://elementaryos.org/ <- not an app, i know... but this is my current OS http://codev.it <- for quick file editing through ftp http://flackr.github.io/circ/ IRC client for chrome https://talky.io/ very easy video conference edit: added codev to the list edit2: added CIRC edit3: added talky2 points
-
I love it when you have to try something new, perhaps only display data under certain circumstances, exclude certain pages or display things conditionally and you think "Ok well I'll just have a go before I go and look up how to do it". Refresh the page and "It worked!" I think to make up for finding this way too easy thanks to PW, I'm going to install Wordpress and then use 3 different plugins to create "custom fields". That ought to teach me.2 points
-
--------------------------------------------------------------------------------------------------------------------------------- when working with PW version 2.6+, please use Pim2, not Pim! read more here on how to change from the older to the newer version in existing sites --------------------------------------------------------------------------------------------------------------------------------- PageImage Manipulator, API for version 1 & 2 The Page Image Manipulator is a module that let you in a first place do ImageManipulations with your PageImages. - And in a second place there is the possibility to let it work on any imagefile that exists in your servers filesystem, regardless if it is a 'known PW-image'. The Page Image Manipulator is a Toolbox for Users and Moduledevelopers. It is written to be as close to the Core ImageSizer as possible. Besides the GD-filterfunctions it contains resize, crop, canvas, rotate, flip, sharpen, unsharpMask and 3 watermark methods. How does it work? You can enter the ImageManipulator by calling the method pim2Load(). After that you can chain together how many actions in what ever order you like. If your manipulation is finished, you call pimSave() to write the memory Image into a diskfile. pimSave() returns the PageImage-Object of the new written file so we are able to further use any known PW-image property or method. This way it integrates best into the ProcessWire flow. The three examples above put out the same visual result: a grayscale image with a width of 240px. Only the filenames will slightly differ. You have to define a name-prefix that you pass with the pimLoad() method. If the file with that prefix already exists, all operations are skipped and only the desired PageImage-Object gets returned by pimSave(). If you want to force recreation of the file, you can pass as second param a boolean true: pim2Load('myPrefix', true). You may also want to get rid of all variations at once? Than you can call $pageimage->pim2Load('myPrefix')->removePimVariations()! A complete list of all methods and actions are at the end of this post. You may also visit the post with tips & examples for users and module developers. How to Install Download the module Place the module files in /site/modules/PageImageManipulator/ In your admin, click Modules > Check for new modules Click "install" for PageImageManipulator Done! There are no configuration settings needed, just install and use it. Download (version 0.2.0) get it from the Modules Directory History of origins http://processwire.com/talk/topic/3278-core-imagemanipulation/ ---------------------------------------------------------------------------------------------------------- Page Image Manipulator - Methods * pimLoad or pim2Load, depends on the version you use! pimLoad($prefix, $param2=optional, $param3=optional) param 1: $prefix - (string) = mandatory! param 2: mixed, $forceRecreation or $options param 3: mixed, $forceRecreation or $options return: pim - (class handle) $options - (array) default is empty, see the next method for a list of valid options! $forceRecreation - (bool) default is false It check if the desired image variation exists, if not or if forceRecreation is set to true, it prepares all settings to get ready for image manipulation ------------------------------------------------------------------- * setOptions setOptions(array $options) param: $options - (array) default is empty return: pim - (class handle) Takes an array with any number valid options / properties and set them by replacing the class-defaults and / or the global config defaults optionally set in the site/config.php under imageSizerOptions or imageManipulatorOptions. valid options are: quality = 1 - 100 (integer) upscaling = true | false (boolean) cropping = true | false (boolean) autoRotation =true | false (boolean) sharpening = 'none' | 'soft' | 'medium' | 'strong' (string) bgcolor = (array) css rgb or css rgba, first three values are integer 0-255 and optional 4 value is float 0-1, - default is array(255,255,255,0) thumbnailColorizeCustom = (array) rgb with values for colorize, integer -255 - 255 (this can be used to set a custom color when working together with Thumbnails-Module) outputFormat = 'gif' | 'jpg' | 'png' (Attention: outputFormat cannot be specified as global option in $config->imageManipulatorOptions!) set {singleOption} ($value) For every valid option there is also a single method that you can call, like setQuality(90), setUpscaling(false), etc. ------------------------------------------------------------------- * pimSave pimSave() return: PageImage-Object If a new image is hold in memory, it saves the current content into a diskfile, according to the settings of filename, imagetype, targetFilename and outputFormat. Returns a PageImage-Object! ------------------------------------------------------------------- * release release() return: void (nothing) if you, for what ever reason, first load image into memory but than do not save it, you should call release() to do the dishes! ? If you use pimSave() to leave the ImageManipulator, release() is called automatically. ------------------------------------------------------------------- * getOptions getOptions() return: associative array with all final option values example: ["autoRotation"] bool(true) ["upscaling"] bool(false) ["cropping"] bool(true) ["quality"] int(90) ["sharpening"] string(6) "medium" ["targetFilename"] string(96) "/htdocs/site/assets/files/1124/pim_prefix_filename.jpg" ["outputFormat"] string(3) "jpg" get {singleOption} () For every valid option there is also a single method that you can call, like getQuality(), getUpscaling(), etc. See method setOptions for a list of valid options! ------------------------------------------------------------------- * getImageInfo getImageInfo() return: associative array with useful informations of source imagefile example: ["type"] string(3) "jpg" ["imageType"] int(2) ["mimetype"] string(10) "image/jpeg" ["width"] int(500) ["height"] int(331) ["landscape"] bool(true) ["ratio"] float(1.5105740181269) ["bits"] int(8) ["channels"] int(3) ["colspace"] string(9) "DeviceRGB" ------------------------------------------------------------------- * getPimVariations getPimVariations() return: array of Pageimages Collect all pimVariations of this Pageimage as a Pageimages array of Pageimage objects. All variations created by the core ImageSizer are not included in the collection. ------------------------------------------------------------------- * removePimVariations removePimVariations() return: pim - (class handle) Removes all image variations that was created using the PIM, all variations that are created by the core ImageSizer are left untouched! ------------------------------------------------------------------- * width width($dst_width, $sharpen_mode=null) param: $dst_width - (integer) param: $auto_sharpen - (boolean) default is true was deleted with version 0.0.8, - sorry for breaking compatibility param: $sharpen_mode - (string) possible: 'none' | 'soft' | 'medium' | 'strong', default is 'soft' return: pim - (class handle) Is a call to resize where you prioritize the width, like with pageimage. Additionally, after resizing, an automatic sharpening can be done with one of the three modes. ------------------------------------------------------------------- * height height($dst_height, $sharpen_mode=null) param: $dst_height - (integer) param: $auto_sharpen - (boolean) default is true was deleted with version 0.0.8, - sorry for breaking compatibility param: $sharpen_mode - (string) possible: 'none' | 'soft' | 'medium' | 'strong', default is 'soft' return: pim - (class handle) Is a call to resize where you prioritize the height, like with pageimage. Additionally, after resizing, an automatic sharpening can be done with one of the three modes. ------------------------------------------------------------------- * resize resize($dst_width=0, $dst_height=0, $sharpen_mode=null) param: $dst_width - (integer) default is 0 param: $dst_height - (integer) default is 0 param: $auto_sharpen - (boolean) default is true was deleted with version 0.0.8, - sorry for breaking compatibility param: $sharpen_mode - (string) possible: 'none' | 'soft' | 'medium' | 'strong', default is 'soft' return: pim - (class handle) Is a call to resize where you have to set width and / or height, like with pageimage size(). Additionally, after resizing, an automatic sharpening can be done with one of the three modes. ------------------------------------------------------------------- * stepResize stepResize($dst_width=0, $dst_height=0) param: $dst_width - (integer) default is 0 param: $dst_height - (integer) default is 0 return: pim - (class handle) this performs a resizing but with multiple little steps, each step followed by a soft sharpening. That way you can get better result of sharpened images. ------------------------------------------------------------------- * sharpen sharpen($mode='soft') param: $mode - (string) possible values 'none' | 'soft'| 'medium'| 'strong' return: pim - (class handle) Applys sharpening to the current memory image. You can call it with one of the three predefined pattern, or you can pass an array with your own pattern. ------------------------------------------------------------------- * unsharpMask unsharpMask($amount, $radius, $threshold) param: $amount - (integer) 0 - 500, default is 100 param: $radius - (float) 0.1 - 50, default is 0.5 param: $threshold - (integer) 0 - 255, default is 3 return: pim - (class handle) Applys sharpening to the current memory image like the equal named filter in photoshop. Credit for the used unsharp mask algorithm goes to Torstein Hønsi who has created the function back in 2003. ------------------------------------------------------------------- * smooth smooth($level=127) param: $level - (integer) 1 - 255, default is 127 return: pim - (class handle) Smooth is the opposite of sharpen. You can define how strong it should be applied, 1 is low and 255 is strong. ------------------------------------------------------------------- * blur blur() return: pim - (class handle) Blur is like smooth, but cannot called with a value. It seems to be similar like a result of smooth with a value greater than 200. ------------------------------------------------------------------- * crop crop($pos_x, $pos_y, $width, $height) param: $pos_x - (integer) start position left param: $pos_y - (integer) start position top param: $width - (integer) horizontal length of desired image part param: $height - (integer) vertical length of desired image part return: pim - (class handle) This method cut out a part of the memory image. ------------------------------------------------------------------- * canvas canvas($width, $height, $bgcolor, $position, $padding) param: $width = mixed, associative array with options or integer, - mandatory! param: $height = integer, - mandatory if $width is integer! param: $bgcolor = array with rgb or rgba, - default is array(255, 255, 255, 0) param: $position = one out of north, northwest, center, etc, - default is center param: $padding = integer as percent of canvas length, - default is 0 return: pim - (class handle) This method creates a canvas according to the given width and height and position the memory image onto it. You can pass an associative options array as the first and only param. With it you have to set width and height and optionally any other valid param. Or you have to set at least width and height as integers. Hint: If you want use transparency with rgba and your sourceImage isn't of type PNG, you have to define 'png' as outputFormat with your initially options array or, for example, like this: $image->pimLoad('prefix')->setOutputFormat('png')->canvas(300, 300, array(210,233,238,0.5), 'c', 5)->pimSave() ------------------------------------------------------------------- * flip flip($vertical=false) param: $vertical - (boolean) default is false return: pim - (class handle) This flips the image horizontal by default. (mirroring) If the boolean param is set to true, it flips the image vertical instead. ------------------------------------------------------------------- * rotate rotate($degree, $backgroundColor=127) param: $degree - (integer) valid is -360 0 360 param: $backgroundColor - (integer) valid is 0 - 255, default is 127 return: pim - (class handle) This rotates the image. Positive values for degree rotates clockwise, negative values counter clockwise. If you use other values than 90, 180, 270, the additional space gets filled with the defined background color. ------------------------------------------------------------------- * brightness brightness($level) param: $level - (integer) -255 0 255 return: pim - (class handle) You can adjust brightness by defining a value between -255 and +255. Zero lets it unchanged, negative values results in darker images and positive values in lighter images. ------------------------------------------------------------------- * contrast contrast($level) param: $level - (integer) -255 0 255 return: pim - (class handle) You can adjust contrast by defining a value between -255 and +255. Zero lets it unchanged, negative values results in lesser contrast and positive values in higher contrast. ------------------------------------------------------------------- * grayscale grayscale() return: pim - (class handle) Turns an image into grayscale. Remove all colors. ------------------------------------------------------------------- * sepia sepia() return: pim - (class handle) Turns the memory image into a colorized grayscale image with a predefined rgb-color that is known as "sepia". ------------------------------------------------------------------- * colorize colorize($anyColor) param: $anyColor - (array) like css rgb or css rgba - but with values for rgb -255 - +255, - value for alpha is float 0 - 1, 0 = transparent 1 = opaque return: pim - (class handle) Here you can adjust each of the RGB colors and optionally the alpha channel. Zero lets the channel unchanged whereas negative values results in lesser / darker parts of that channel and higher values in stronger saturisation of that channel. ------------------------------------------------------------------- * negate negate() return: pim - (class handle) Turns an image into a "negative". ------------------------------------------------------------------- * pixelate pixelate($blockSize=3) param: $blockSize - (integer) 1 - ??, default is 3 return: pim - (class handle) This apply the well known PixelLook to the memory image. It is stronger with higher values for blockSize. ------------------------------------------------------------------- * emboss emboss() return: pim - (class handle) This apply the emboss effect to the memory image. ------------------------------------------------------------------- * edgedetect edgedetect() return: pim - (class handle) This apply the edge-detect effect to the memory image. ------------------------------------------------------------------- * getMemoryImage getMemoryImage() return: memoryimage - (GD-Resource) If you want apply something that isn't available with that class, you simply can check out the current memory image and apply your image - voodoo - stuff ------------------------------------------------------------------- * setMemoryImage setMemoryImage($memoryImage) param: $memoryImage - (GD-Resource) return: pim - (class handle) If you are ready with your own image stuff, you can check in the memory image for further use with the class. ------------------------------------------------------------------- * watermarkLogo watermarkLogo($pngAlphaImage, $position='center', $padding=2) param: $pngAlphaImage - mixed [systemfilepath or PageImageObject] to/from a PNG with transparency param: $position - (string) is one out of: N, E, S, W, C, NE, SE, SW, NW, - or: north, east, south, west, center, northeast, southeast, southwest, northwest default is 'center' param: $padding - (integer) 0 - 25, default is 5, padding to the borders in percent of the images length! return: pim - (class handle) You can pass a transparent image with its filename or as a PageImage to the method. If the watermark is bigger than the destination-image, it gets shrinked to fit into the targetimage. If it is a small watermark image you can define the position of it: NW - N - NE | | | W - C - E | | | SW - S - SE The easiest and best way I have discovered to apply a big transparency watermark to an image is as follows: create a square transparent png image of e.g. 2000 x 2000 px, place your mark into the center with enough (percent) of space to the borders. You can see an example here! The $pngAlphaImage get centered and shrinked to fit into the memory image. No hassle with what width and / or height should I use?, how many space for the borders?, etc. ------------------------------------------------------------------- * watermarkLogoTiled watermarkLogoTiled($pngAlphaImage) param: $pngAlphaImage - mixed [systemfilepath or PageImageObject] to/from a PNG with transparency return: pim - (class handle) Here you have to pass a tile png with transparency (e.g. something between 150-300 px?) to your bigger images. It got repeated all over the memory image starting at the top left corner. ------------------------------------------------------------------- * watermarkText watermarkText($text, $size=10, $position='center', $padding=2, $opacity=50, $trueTypeFont=null) param: $text - (string) the text that you want to display on the image param: $size - (integer) 1 - 100, unit = points, good value seems to be around 10 to 15 param: $position - (string) is one out of: N, E, S, W, C, NE, SE, SW, NW, - or: north, east, south, west, center, northeast, southeast, southwest, northwest default is 'center' param: $padding - (integer) 0 - 25, default is 2, padding to the borders in percent of the images length! param: $opacity- (integer) 1 - 100, default is 50 param: $trueTypeFont - (string) systemfilepath to a TrueTypeFont, default is freesansbold.ttf (is GPL & comes with the module) return: pim - (class handle) Here you can display (dynamic) text with transparency over the memory image. You have to define your text, and optionally size, position, padding, opacity for it. And if you don't like the default font, freesansbold, you have to point to a TrueTypeFont-File of your choice. Please have a look to example output: http://processwire.com/talk/topic/4264-release-page-image-manipulator/page-2#entry41989 ------------------------------------------------------------------- PageImage Manipulator - Example Output1 point
-
I created a simple module that allows you to log in using your e-mail address rather than username: https://github.com/m...lAuthentication A couple of thoughts: This should be a built-in option in the login module, rather than an add-on - most sites have taught users to log in with their e-mail address. (I tend to forget what my username is - on most sites I don't have one!) The Session and ProcessLogin APIs need to be more extensible - for instance, to allow modifications to the form or fields. Modules like "login via Twitter" etc. will soon be something that people demand. I wish the build...form() methods in PW were more generally open to hooks...1 point
-
In some previous posts, I demonstrated a simple proof-of-concept CRUD “application” for PW using jTable. I really wanted to use DataTables since it is older, wiser and with a huge fan base. One thing I wanted was for the CRUD system to be as simple as possible and possibly be Excel-like (more below). With DataTables plugins, you can perform stuff like inline-editing and Auto-fill. The latter works just like in Excel and allows you to quickly populate cells (quick copy). But that’s as far as it goes. Google led me to other Table management systems. Some of the front runners include jqGrid and SlickGrid. SlickGrid is nice and using virtual rendering can display millions of rows with ease. Its support for displaying data delivered on demand (Ajax/server) is minimal; it requires you to download all your data before it starts manipulating it. Someone has created an Excel-like extension for it allowing copy-pasting between SlickGrid and Excel. Awesome! But, it still didn't rock my boat completely, especially the Ajax content issue. Then I stumbled upon Handsontable, a new kid on the block that describes itself as “a minimalistic Excel-like data grid editor for HTML, JavaScript & jQuery”. Though relatively new, it is as Excel-like as you can get. You can copy-paste from/to Excel [single to multiple cells and multiple to multiple cells], use the usual shortcuts (Ctrl-A, Ctrl-X, Ctrl-C, Ctrl-V, Ctrl-Y, Ctrl-Z - i.e., undo/redo, etc., and tab navigation, etc.), use Auto-fill (vertically and horizontally), freeze cells/columns, make cells/columns read only, Right-click context menus, insert/delete rows and columns, perform inline-editing, etc. Double awesome! Handsontable (HoT) is minimalistic but comes with a rich API. However, most of the implementation is down to you (sounds familiar?). It will render the Table and provide you with Methods/Events/Options to manipulate it. You just have to provide the data as an Array or JSON defining your columns and containing your data. Soma has a DataTable module that is currently read only; you cannot edit the displayed data directly in the table. It is also in lazy development . So, I started toying with the idea of using HoT as an Excel-like CRUD system (module) for PW. I wanted something that could quickly and easily do mass editing (Batcher-like). Imagine quickly creating basic pages/records by copy-pasting from Excel. Or quickly changing records by dragging (Auto-fill) or pasting new values over old ones. Well, the result can be seen in the screencast below. I’d like to hear your thoughts whether this is something that I should consider developing into a module; something that could be used by Superusers. Depending on implementation, it could be used by other users as well. All HoT needs is data. What you do with that data is up to you (the developer) and your code! This can be very dangerous if not implemented correctly, of course! You could easily delete important records! However, HoT does not touch your database! Deletions, insertions, etc., will not alter your database unless you specifically write the PHP code to do that. All it does is send data to the server via a method your specify (post, get, Ajax, etc.), and even that is your implementation. You do not need to implement deletions or additions. You can use it for updating content only or as read only, but where’s the fun in that ? In the screencast , apart from the table itself, all the other implementations are custom - the buttons, selects, auto-save (can be tricky? can DDOS your server?). The current implementation is not perfect; it is a demo after all. Certain stuff would need to be implemented differently . I didn't want to spend too much time on something that would not be useful in the end. All CRUD operations are via PW API and/or vanilla PHP. Deleted pages are Trashed and not permanently deleted. If there is interest for a module of this kind, I would request all the help I can get to develop it please. I would put it up on Github of course. In the demo, this is running off Diogo’s ACP module. Let me hear your thoughts please. Should a module like this see the light of day? Thanks Wasn't sure in which forum to post this...1 point
-
1 point
-
http://processwire.com/talk/topic/696-quick-guide-to-the-comments-system/page-31 point
-
$img->imLoad("bright_") should be $img->pimLoad("bright") I think. Don't know why the underscore. and you've a typo in the "pim" <blink>Horst wins !</blink>1 point
-
Thanks for the hard work here Horst! Looks like a very useful and good implementation. I'm in need of such a tool right now and I can't get it to work. When calling this in a template I get this error. site/assets/files/1111/source_gartenidylle_031007_151328.jpg Fatal error: Exception: Method Pageimage::imLoad does not exist or is not callable in this context (in /xxx/dev.urlich/wire/core/Wire.php line 320) #0 /xxx/html/dev.urlich/site/templates/home.php(32): Wire->__call('imLoad', Array) #1 /xxx/html/dev.urlich/site/templates/home.php(32): Pageimage->imLoad('bright_', Object(Pageimage)) #2 Code is this: $p = wire("pages")->get(1111);echo $p->image->url; $img = $p->image; $pim = $img->imLoad("bright_")->contrast(100)->brightness(100)->pimSave(); The module is loaded and the hook should be added (according to debug admin info) but the error suggests not? I tried with loading the module but then I get another error. /site/assets/files/1111/source_gartenidylle_031007_151328.jpg Fatal error: Exception: Cannot load the MemoryImage! (in /xxx/dev.urlich/site/modules/PageImageManipulator/ImageManipulator.class.php line 1216) #0 /xxx/dev.urlich/site/templates/home.php(32): ImageManipulator->contrast(100) #1 I have no idea what could cause the problem, maybe it's just me and the server. Some minor things: - Your modules code has tabs and space indents mixed. Something I'm aware of because I use SublimeText2 and It does what it automatic. - I found the name "PageImage" inconsistent to the core which uses "Pageimage". - I get a Warning: Invalid argument supplied for foreach() in /xxx/dev.urlich/wire/modules/Process/ProcessModule/ProcessModule.module on line 671 on module screen of PageImageManipulator1 point
-
I have just one problem with this approach. It's perfect for what I need for a site where customers can buy things/services as every email address is unique, however a username might not be! For example, if I have two customers called John Smith sign up, I have to do a check during registration to make sure that if there is a John Smith already that a number gets appended to their username (so john-smith-1 or something like that). Feels a bit messy, but there really isn't any way around that I guess? I'm being too picky though I think as even when a user edits their profile they don't need to know that behind the scenes their user page is stored with a name of john-smith-1 Okay, I'll shut up now since I've talked myself out of actually having a problem!1 point
-
I like to solve it by having a lot of specific templates, and only 1 basic-page type template. This is in part because I really like to keep pretty strict family settings for each template, so that the client doesn't ever have to decide what template to use when creating a page, and they don't have the option to create pages where they shouldn't. It also opens more options for current or future access control. But the actual template files are pretty spartan, and many of them totally blank, some set or modify a few variables, and others simply include another. I rely on my prepend/append template files to handle all of the common stuff (_init.php and _main.php) leaving the other template files focused purely on any components that are unique for the template. In terms of scalability, I also like having lots of template files, even if there isn't much in them, because future additions and modifications are very simple. So far this way has worked really well for the last few sites I've used it on, but I don't think any one method works best for everyone because we all have slightly different needs.1 point
-
Also take a look at the Foundation site profile that uses both $config->prependTemplateFile and $config->appendTemplateFile options. It also takes the approach of defining a bunch of shared functions, similar to what you were trying to do. I have no idea why yours didn't work though, as if you include a file with functions defined in it, then those functions should be available to any code that follows it, regardless of what file the code is in. I think that either the Skycrapers or Foundation profiles would be good examples to look at.1 point
-
Greetings, Thanks everyone for these ideas. As always with ProcessWire, there are many ways to accomplish what needs to be done. In my search for an AWS solution, I came across this code for Laravel. I think it can either be adapted to ProcessWire, perhaps as a module: https://github.com/aws/aws-sdk-php-laravel Thanks, Matthew1 point
-
I've been really enjoying using Bohemian Coding's Sketch app for the past couple of months and recently I noticed their official user manual for Sketch is powered by ProcessWire! How cool is that?! http://www.bohemiancoding.com/sketch/help/1 point
-
1) you may do this by using a hidden tools page with an images field and than you only have to use $page->images->add($shotImageUrl) to save the image to the tools page assets directory. And you have it as PageImage and you can do all image api stuff 2) I have uploaded a new module for Image Manipulation. With this you are able to use some well known image methods (width, height, size) and you can store the image together with your xml or json file instead of creating and using a tools page with InputFieldtypeImage. Example (this could be somewhere in your makeRequest method): // get your image from dribble and save it to your cache directory $shotImageUrl = 'http://dribble.com/some/path/to/image.jpg'; $imgCacheFile = $this->cachePath . md5($url) . '.image.jpg'; $result = file_put_contents($imgCacheFile, file_get_contents($shotImageUrl)); // if $result is not false and greater than zero the image was successfully saved, // now you can load the $imgCacheFile into the ImageManipulator, resize it and save it by overwriting the $imgCacheFile $boolResult = wire('modules')->get('PageImageManipulator')->imLoad($imgCacheFile)->resize(360)->save(); // thats all PS: if you want rely on the PageImageManipulator module, you can set it as needed dependency for your module: public static function getModuleInfo() { return array( // ... 'requires' => array('PageImageManipulator'), ); } see: http://processwire.com/talk/topic/778-module-dependencies/1 point
-
There was a bug in the InputfieldCKEditor module that made the "Anchor" tool not work. In fact, if you clicked on it, it basically freezes the page and you can't do anything but reload. This is a result of the Anchor tool now requiring the Link plugin in CKEditor (as of version 4.1.2 I think). Since the Link plugin was in our default "Removed Plugins" configuration setting, the Anchor tool is broken. In order to fix it, edit your field settings, click the "input" tab, and remove "link" from the "Removed Plugins" list. Alternatively, you can just update your InputfieldCKEditor to the latest version v1.1.1 and it will take care of this for you. The latest version of InputfieldCKEditor also updates the CKEditor version from 4.1.2 to 4.2.0 and has a few more tweaks as well, so it's worth the upgrade even if you don't use the Anchor tool.1 point
-
I was doing a favor today for someone who's stuck with a custom WP "theme" and wants some special functionality on top. Looking at all this mess, I shuddered, more than once.1 point
-
ProcessWire gives me the old Apple feeling back. ( talking about 10/15 years ago) But we have our own Steve Jobs! Ryan Cramer has the vision, the knowhow and the social aspect we all adore. I love the things that are not in the admin, and how to handle all those other aspects. (api) I don't want a assets manager ( if there's no reference ) I don't want endless settings on a shared place. I don't want to explain ( in tutorial ) how a site works. I don't want to use some kind of TPL language inserting logic in a textfield. I don't want a headache to get data. All the above I can easily build/do with ProcessWire, the fact that I can I really love.1 point
-
This functionality would be very much like Advanced Custom Fields "Flexible Content" Addon (http://www.advancedcustomfields.com/add-ons/flexible-content-field/). Which is probably at this point the only thing I miss about building WordPress sites. I found that clients found it easy to use and I didn't have issues with clients making a huge mess. It is a controlled system so testing for issues is quite easy.1 point
-
See this Comments Fieldtype documentation page sections on customizing output and styling output. While it makes it easier, you don't actually have to use the built in methods for rendering the comments list or form. You can create your own markup entirely if preferred. However, I do think it would be worthwhile to copy or extend ProcessWire's /wire/modules/Fieldtype/FieldtypeComments/CommentForm.php file to your own class (MyCommentForm) in /site/templates/. When you want to render your form, you would do this: include("./MyCommentForm.php"); $form = new MyCommentForm($page, $page->comments); echo $form->render();1 point
-
It just occurred to me that it would be amazing to be able to use a datatable for repeaters. I know it's certainly by no means a simple request, but it would definitely be neat and in some cases preferable when handling lots of repeaters or working with certain data types. Just a thought.1 point
-
This topic has come up a few times and this method of image management is required for some websites (often article sites where you might have one image for a subject and re-use it). arjen posts a good solution which may or may not be what you're after, as it relies on knowing where the image was last used if you're re-using it. It might suit your needs, but I'll offer up an alternative. A simple way to achieve this as per your requirements of 3 directories of images is to create a template called "gallery" and simply give it an "images" field. Then, create 3 pages (mark them as hidden) to mimic your 3 EE directories and add your images. In the WYSIWIG editor for any page you can select an image from another page, so this in effect acts like an image gallery for you in the way you're used to1 point
-
Hi Stephen, Welcome to the forums and good question. Here's one way you could approach it, assuming all those posts were under the same page (like /blog/). I'm somewhat limited on time right now, so this is written in the browser and not tested, but I can follow up with more detail later if you'd like. <?php $blog = $pages->get("/blog/"); $startYear = date("Y"); // this year $endYear = 2009; // or whenever you want it to end $now = time(); for($year = $startYear; $year >= $endYear; $year--) { for($month = 12; $month > 0; $month--) { $startTime = strtotime("$year-$month-01"); // 2011-12-01 example if($startTime > $now) continue; // don't bother with future dates if($month == 12) $endTime = strtotime(($year+1) . "-01-01"); else $endTime = strtotime("$year-" . ($month+1) . "-01"); $entries = $blog->children("created>=$starttime, created<$endTime"); // or substitute your own date field $date = date("m-Y"); echo "<li><a href='./$date'>$date - " . count($entries) . "</a></li>"; // output the month and count } } Then you'd use the same template to list the entries when a $input->urlSegment1 has a date specified in it. Basically you'd cycle through the $entries found above and link to them. This is rough and just approximate. I'll be glad to follow up with more detail... but wife is telling me to get off the computer.1 point