Leaderboard
Popular Content
Showing content with the highest reputation on 05/06/2014 in all areas
-
On the popular gaming plattform PlayCatan (http://playcatan.com/), we use Processwire as CMS for all help pages, FAQ, game manuals and news. The contents are embedded as single pages via colorbox.js and iFrames, so the do not interfere with a potentially running Canvas game. We use Markdown and some custom tricks for the content editors. So far it is a great pleasure11 points
-
I am sure some of you must have noticed my stumbling around in the dark while getting used to the ProcessWire system. Someday I hope to emerge as a user who brings more to the table than just silly newbie questions. I am sitting down with a mug of really good coffee so I thought I would offer my feelings and reactions to ProcessWire thus far… Quick background: I am a photographer with a long history in photojournalism and commercial work. I have also enjoyed doing web work for years. I built quite a few static sites before searching for a CMS system that felt like home. I must have tested about a dozen or so before spending some real time with Wordpress and then MODx. I liked Wordpress but the template system was awkward for me to me customize. I then found MODx Evo. I stuck with Evo for years and found it very designer friendly. I am not a code developer at all but Evo allowed me the flexibility to design static test pages using clean HTML and then create my Evo template from that foundation. MODx uses a system of combining placeholder code using Chunks, programmed Snippets and Template Variables (TVs) for dynamic forks in the road. Forgive me: I have never been well versed in web tech jargon. One of the features (or liabilities) with MODx is that it uses its own template language. When you deploy a Snippet you need a Snippet “Call” to set parameters on how the Snippet will function. Usually you would need a special template for the Snippet as well. This process is not totally intuitive and has its own learning curve. Then along came the entirely new branch of MODx called Revolution, or Revo for short. Revo was more powerful but also more complex. The nice thing with Revo is that you could spend more time away from the root folder or using an FTP client to upload and install Snippets. The Package Management system is a powerful means of installing and updating the various Snippets and plugins. Updating these building blocks in Evo is more of a pain; manual copy and paste effort required. What I did not like with Revo is that much of the placeholder and template syntax changed from Evo. The changes were subtle but deadly if you confused the two. The main issue I have with Revo is how slow the Manager (admin) system is. The amount of stuff (very techie term here) in Revo is overwhelming. Some of my clients who used the Revo Manager sporadically would always forget how to do things. To be honest I would have the same issue on occasion. With MODx we had Evo, then Revo, then the whole cloud system and now MODx III. It sort of gets confusing. To counter this the forum now has a zillion sections that cater to all the MODx project branches. But I find doing a search on my issues or questions revealed some confusing links to information that focuses on a different branch or is outdated to the system I am working with. I guess this last year was a difficult year for MODx: growing pains and money, etc. The whole technology of Revo, the Cloud and the loss of some of its main core programmers (Shaun McCormick) has created some signal-to-noise-ratio issues. Last year was a terrible year for me personally as well. The joy of buying a new project house was crushed by the death of my father and my only sibling (in South Africa) in the space of just four months. Coming out of this fog I sought of stumbled on some interesting chatter about MODx users switching to ProcessWire. The rest of this quick moving journey has been interesting to say the least. My reaction to PW has been filled with both initial confusion and admiration. I thought my not knowing any PhP was going to be a deal breaker. I sort of had initial writer’s block with the blank page. The PW installation would go well, but then what? But after playing around with several local test installs I can see how liberating and powerful the PW API, the template system and Fields really are. I am slowly picking up some basic use of PhP statements. Doing so is more valuable and efficient than the MODx learning curve with it’s proprietary template syntax. I suspect my working knowledge of the PhP that will make using PW easier will only grow with time. That is my hope for sure. The thing I like about the PW Admin is the speed and the whole weight of the backend. Compare the jQuery Admin to the heavy, heavy MODx Revo Manager and there is no contest. It works better on the iPad as well. My clients have commented on how much “stuff” there is in the Revo Manager. I can’t wait to show them how fast and simple the PW Admin is by comparison. One of my issues is letting MODx go. The community has been great. I cant tell you all how much I admire and appreciate folks like Susan Ottwell, Bob Ray, Jay Gilmore and countless others. Susan has over 20,000 posts on the MODx forum. Just about all of them are consistently helpful and insightful. Being a heavy forum contributor can lead to one’s becoming impatient and suffering from burnout, but Susan’s helpful attitude has been amazing. But my heart tells me that I am better suited to learning ProcessWire rather than the awkward mix of MODx Evo and Revo that I have been using to this point. I think I am also trying to duplicate some MODx procedures when I work with my PW test projects. I think that time will be on my side as I become more comfortable doing things the “ProcessWire way”. Anyway, I am not sure where I am going with this, I just wanted to offer my $.02 and to say how grateful I am with all of you who have shown patience with my initial learning. Cheers, Max7 points
-
We just launched a new PW 2.4 site: mbci.mb.ca, this is another responsive (bootstrap) site built using my module Spex. The homepage is one of our first attempts at what we internally call "long scrollies", we used the jquery plugin waypoints to accomplish the effect that can be seen there. Using waypoints has really opened up a new realm of possibilities, especially when combined with stellar.js to create parallax effects. Other than the long scrolly homepage, in terms of neat features there's a filterable ajax calendar page using the fullcalendar library: http://mbci.mb.ca/events/ There's also a matching Magento for taking applications to the school where we used an extension called Dynamic Product Options from the unfortunately named company Itoris, that was pretty neat.7 points
-
I was able to reproduce issues with latest dev 2.4.2, while working in 2.4.1 still. Took me couple hours to get around the problems introduced here, but somehow found what the issue was and committed a fix just now. Part of it is still hackish, and it seems I can't set a custom upload path for InputfieldImage anymore. So it will take now the admin page assets folder for uploading. This results in you don't have to set a temp upload folder (took it out for now). Also made sure images uploaded get deleted in case of errors. Added check tomake sure parent catgegory page is selected before uploading. Added support for showIf dependencies, so the file input will only be shown when a parent is selected, this will only work for 2.3+ (?). Some minor changes in ImagesManagerParser to account for upcoming new fieldtypes by Ryan. Meanwhile I found some bug in InputfieldPageListSelectMultiple that makes it not work with inputfield dependencies, I submitted a PR for Ryan. I got it still working with a trick. So unless there's other changes to image/file inputfields this version should be save for 2.4 and upcomming 2.5. But after all still a proof of concept!6 points
-
Just dropping this here since i found it very handy for testing websites in (old) IE on different Windows OS. Here you can download different Windows OS VM images for different VM software that run on WIN, MAC and LINUX. http://www.modern.ie/en-us/virtualization-tools#downloads I'm running Virtual Box on OSX which is free.5 points
-
Ah. The thing is, I just tested now again, that when you use current user object $user echo $user->avatar->first->url; // will be an array of type Pageimages It will always be an array, cause no output formatting for the $user. BUT if you load the user via API, it's different... $u = $users->get("username"); echo $u->avatar->url; // will be single object of type Pageimage cause output formatting is now on. Got it? ;D (I sometimes think it would be easier and less confusing if this output formatting behaviour wasn't there for images.) sure: $user->avatar->removeAll(); $user->avatar->add($newimage); $user->save();3 points
-
Add this: <ul class="menu"> <li><a href="<?=$config->urls->root?>">Home</a></li> <?php ... or use this: http://modules.processwire.com/modules/markup-simple-navigation/2 points
-
Author of JShrink here (I found you guys in my web logs). I thought I'd pop in and say hello, and talk about JShrink a bit. I originally made it as a drop in replacement for JSMin, because JSMin is technically not open source (it has the "do no evil" license, so projects that take open source seriously, such as Debian, won't bundle projects with it). Since then I've made improvements on speed, added additional features like support for conditional comments and license preservation, and have really put work into the test suite itself. Ryan Grove, who originally ported JSMin to PHP, has officially dropped the JSMin project and is referring people to JShrink on the Github page for it. Yesterday, after several years of being in the "beta" phase, I launched the JShrink v1.0 to make the API official and stable. On a tangental note, I also maintain a caching library called Stash that may be useful to you.2 points
-
Good news! http://blog.atom.io/2014/05/06/atom-is-now-open-source.html2 points
-
I don't think that's the problem. I think you're having issues here: <?foreach ($page->children as $c):?> and <?foreach ($page->children as $directors):?> They are the same loop, with the same set of children being iterated so it makes sense that every time you add a directors page you get another box being drawn, but it's empty because your fields (with the exception of image) are named differently. Try using a selector to specify the template. Maybe: <?foreach ($page->children("template=staffCardTemplate") as $c):?> ... Rest of Code <?foreach ($page->children("template=directorsCardTemplate") as $directors):?> That way your code only grabs children of the appropriate template when iterating.2 points
-
You're welcome. I just realized that this module needs some love from me soon And sorry, you're right. It won't trigger the download unless page A does call the render method somewhere in the template. But it should work then if you call it. I'll test this evening. On page A, if you don't want to output the a link but still make the download work, you could call the method without echoing out its output, like this: $modules->get('Pages2Pdf')->render();2 points
-
I noticed that although there's an InputfieldSelect module, there wasn't a FieldtypeSelect that would produce a drop down list (via a "select" input) that would allow you to define a list of options in the field's configuration. (Somewhere in this forum, I saw that the "Page" fieldtype was suggested to do this - and it works - but it didn't seem as easy as it should be.) So, I went ahead and created a module to do it! After installing, you'll have a new "Select" fieldtype that will allow you to define the items you'd like in the drop down. You'll be able to define these options in a text box on the field's configuration screen. Just put each option on it's own line. Hope this helps someone out! Let me know if you experience any issues with it, find any bugs or if you have some ideas on improvement. EDIT: The module is now on github: https://github.com/Hani79/Processwire_FieldType_Select_Drop_Down (Thanks for the prompt to put it up there, Soma.)1 point
-
This is a very simple module that I put together for @Zahari Majini from a PM request. It allows you to enter a URL to a YouTube or Vimeo video in a specified field and when you save the page, it will grab thumbnails for the video and add them to a specified images field. Check the module configuration options for: the field(s) to search for videos name of the video images field which thumbnail(s) you want grabbed whether to grab the first available or all available thumbnails based on those that you list As always, an feedback for improvements is very welcome! Modules Directory: http://modules.processwire.com/modules/process-get-video-thumbs/ Github: https://github.com/adrianbj/GetVideoThumbs1 point
-
ElasticSearch does a lot, but the part that is most interesting to me is that it does an amazing job of fulltext search. It's also crazy fast. It can be a bit scary at first so hopefully this module will make it more accessible. I threw together this module pretty quickly, it's more of a proof of concept than anything else at this point. I tried it out on a site with 400 bilingual pages and the search results are much improved over the normal search you would get doing like queries or fulltext queries in mysql. Github page: https://github.com/jdart/ElasticSearchProcessWire I'd love to hear some feedback on how it works for you. It's very new so expect bugs, in particular the mechanism that turns pages into data to be indexed by ES might have some surprises.1 point
-
I just pushed ProcessWire v2.3.1 to the dev branch. This is a fairly major change in that it switches the DB driver from mysqli to PDO. It meant changes to a large percentage of core files. ProcessWire still supports mysqli, but doesn't attempt to use it unless a module or a template asks for it via the $db API variable. The new API variable (for the PDO driver) is $database. More about PDO at php.net If you are using the dev branch, be careful and test thoroughly with this latest commit to it. Before upgrading, you may want to double check that your PHP supports PDO by looking at your phpinfo (CMD-F or CTRL-F for "PDO"), especially if you are running PHP 5.2.x (where PDO wasn't compiled in by default). Though if you are running PHP 5.2 (vs 5.3.8+) then you may want to just stick with ProcessWire 2.3.0 and upgrade your PHP version when possible. If you are using any modules that use the procedural version of mysqli functions (vs. the $this->db object oriented versions), or type-hint mysqli in methods, then those modules will no longer work. If you come across any modules that don't work with 2.3.1, please let me know here so that I can assist the author in updating them. Note that FormBuilder is one of the modules that does not work with 2.3.1, but I have posted an update in the FormBuilder board that corrects it–so be sure to download that version if you are tracking the dev branch of ProcessWire and using FormBuilder. What this new version adds: 1. New API variable $database that refers to the PDO database. The old $db API variable is still there and refers to mysqli for any modules that continue to use it. 2. New API variable $log that lets you easily log messages or errors to the system logs. Usage: $log->message("This saves this line to messages.txt"); $log->error("This saves this line to to errors.txt"); $log->save("my-log", "This saves this line to my-log.txt"); // Get an array of the last few entries saved to the messages log $entries = $log->get('messages'); // Get an array of the last 50 entries saved to my-log $entries = $log->get('my-log', 50); Note that as always, log files are located in /site/assets/logs/. 3. Conditional autoload modules. In PHP 5.3+, modules may now specify an anonymous function OR a selector string, rather than a boolean for the 'autoload' property returned by getModuleInfo(). PW runs the anonymous function after determining the current $page, so your module can make autoload decisions based on the $page (or any other factor you'd like), if desired. Lets say that we have a module that we only want to autoload when the template is 'admin': public static function getModuleInfo() { return array( 'title' => 'Module Title', 'summary' => 'Summary text...', 'version' => 1, 'autoload' => function() { if(wire('page')->template == 'admin') return true; else return false; }); } And the same example but using a selector for autoload: public static function getModuleInfo() { return array( 'title' => 'Module Title', 'summary' => 'Summary text...', 'version' => 1, 'autoload' => 'template=admin' ); } 4. Addition of $pages->add() method. Actually $pages->add($template, $parent, [string $name], [array $values]); This function adds a new page to the database and returns it. This is for syntax convenience, but using the old method is still perfectly fine too. Here's a few examples of usage: // add a new page using template basic-page under /about/ $newpage = $pages->add('basic-page', '/about/'); // same as above, but named 'contact' $newpage = $pages->add('basic-page', '/about/', 'contact'); // same, but populate the title field too $newpage = $pages->add('basic-page', '/about/', 'contact', array('title' => 'Contact Us')); // you can also do this, specifying the values array as 3rd argument: $newpage = $pages->add('basic-page', '/about/', array('title' => 'Contact Us')); $template and $parent are required, but may be objects, IDs, or string identifiers (like name for template, or path for page). When you add a new page and don't specify a 'name', then PW will make one up, guaranteed to be unique. 5. Module files that end in '.module.php' are now supported. So rather than ClassName.module, you may use ClassName.module.php if you prefer it. The purpose here is to support text editors that determine their syntax highlighting based on the file extension. More updates being made almost daily. Please report any issues you experience. Thanks, Ryan1 point
-
Hey, I just thought it might be helpful to have a guide for your module's presentation: The Title The title of a module is an important part of it. It should kind of make the main function of a module understandable after the first reading. So there are some guidelines for naming a module: (via http://processwire.com/api/modules/) Here is a more extended list of some "module prefixes" and a short description for each: (via http://processwire.c...-module-naming/) The Description A good description is another important part of your module's presentation. Here is a short list of sections you could (or maybe should) include in it: General: The main function of your module How to use: A description of how to use your module which maybe includes some details the user won't see directly. Installation: If there is something special about the installation of your module you should add this to your description. Screenshots/-casts: It's awesome if you would take a picture of your module (if it changes or adds something the user is able to see). Or maybe a screencast if you like to. (Great example: http://processwire.c...ncy-admin-mode/) Links At the end of your post you should add some links like where the user can download the plugin and if you've added your module to the module section you should post the link here too. Module Section If you've posted your module already to the modules section you can easily copy it's contents there and use them for your post here or - of course - the other way around. I hope this post was helpful to you. Greets, Nico1 point
-
It's not often I'm impressed, so I only feel that it's right to express my appreciation to those behind the development of PW. I've only been using PW since March this year, but it's been a joy to work with. I knew nothing about PHP beforehand, and now I'm able to achieve my goals without too much stress thanks to the excellent PW API. For my current project, I'm jumping in at the deep end by creating an online community where my members will have a basic forum, comments system, gallery, private messages etc. At first I thought this would be an impossible task, but my custom comments system seems to be coming along nicely, all without any stressful programming. I'm fairly sure I'm doing a few things wrong, and I'm sure there are more efficient ways to deal with my problems, but that's what I love about PW, we can do it our way. For my comments system (which I've started from scratch as a learning exercise) I simply wrote some template code to check for a sub-page called "comments" under the current page, article etc. If it's not there, it will be created when a comment is posted. This comment would then appear as a new page under the comments page, as would all the other comments. I'm not sure if this is a good way to go about it, but it works, and I can keep developing it to allow comment editing, quoting etc. Anyway, thanks again. I look forward to see what the future holds for PW, but as it currently stands, it's exceptional.1 point
-
Thanks for sharing this and sorry for your losses. It's always interesting to read about initial reactions to ProcessWire -- it's a great system, but surely there's always room for improvement, and in this regard it's good to have folks with experience from others systems around too. I've never used MODx myself, all I know about it is what I've read from this forum.. and when someone mentions "evolution" or "revolution", I instantly think of Harley engines1 point
-
I don't know how much work it would be... Could You update your module to accept a page selector as parameter? Default should be the current page. So every page could be generated as pdf everywhere? Don't get me wrong! I like it as it is! But generate a pdf of a given page would be awesome1 point
-
if (count($user->roles) === 1) { echo "I'm guest & guest only."; }1 point
-
WOW Great! I will download asap some VM´s... Thank you Raymond for sharing with us!!1 point
-
1 point
-
While testing with ImageSizer and ImagickResizer I have encountered that there are some glitches in the dimension calculations. A simple testcase I have used is to downsize an image to the half of a dimension and -1, -2, -3, +1, +2, +3 pixels. This results in 5 failures: After wrapping a ceil() here and here, there were only 2 failures and 5 succeeds: Therefor I have changed this floor to round, and this one too. This results in 7 succeeds: I send a pull request and refer to this post here, (because I do not know how to embedd images in a github pull-request or comment. --- PS: only changing the floors to rounds and not wrapping the ceils results in 5 succeeds and 2 failures1 point
-
PhotoWebMax, I think your post is very perceptive. ProcessWire appeals very much to people who are both designers and developers. It also works well for teams who divide up those responsibilities. However, it doesn't make any attempt to do development for you (like Joomla or WordPress might, for example). Having said that, what it does do is reduce the learning curve on the development side as much as is possible without sacrificing capabilities or imposing limitations on what can be done with it. I started ProcessWire as a designer too, so you're in good company. Most of my sites were not built on CMSs because I could never get the big ones (Joomla, Drupal, or WordPress) to do what I wanted, or to do it in a way that would be intuitive for my clients to manage. Anyway, the only php experience I had was using includes in my regular html sites (and whatever I could remember from the one or two non-php-based programming classes I had taken). What really drew me to PW was that I could continue making sites exactly the way that I always had-- writing all my own html, css, and choosing when and where to break up my code into external includes. And I didn't even have to learn a new syntax for that, since it was all php-based. From there, it was just a matter of learning how to grab the data from the CMS that I needed to be dynamic and putting it into my template files with the API. Going through this process opened me up to the world of development. I won't say that it was easy (or that I don't still have a lot to learn), but for me PW made programming fun and intuitive, and actually seem attainable for a design-minded person like me. And by spending time on these forums and asking a lot of questions, I was able to get up and running with the basics right away and then learn the more complex stuff from there. Now that you've described what you're trying to do with having galleries as a part of multiple templates, I do believe you have a good approach for your use case. Please don't get hung up on my way of doing things. Do what makes sense to you and will be easy for you to manage. If that means loading the scripts on all pages and sacrificing a tiny bit of page load speed, then do that. Heck, if repeating the code in every template file and not using includes at all makes it easier and gives you the more granular level of control that you need, then do that. I only looked at MODx briefly before I found PW, so I can't speak to the similarities and differences. But I will say that once I finally found PW I haven't looked back1 point
-
Something like this can be used to create a new PageArray $somepages = $pages->find("template=news, limit=10"); $parray = new PageArray(); $parray->add($somepages); // add one page (or also multiple since 2.2.2) // or $parray->import($somepages); // add one or multiple pages from another PageArray $parray->sort("-modified"); ... Edit: If you have an array with id's that's also cool: $ids = array(1002,1004,2303,4342); $parray = new PageArray(); foreach( $ids as $id ) $page->id ? $parray->add( $page->get($id) ) : continue ;1 point
-
Hani, nice work with this fieldtype, as well as the state select one. I tried both out and they work well! I should explain why PW doesn't implement selects in the manner that this plugin does. This plugin stores values are not normalized; it uses the database as a non-relational flat file. One of the resulting issues if that if you need to go back and change or remove one of the options, your change will not affect any values already present, ultimately corrupting the data. This could be a problem in large scale usage. PW uses a Page fieldtype to achieve the same thing (albeit with a little more effort) so as to avoid the issues mentioned above and others. But the reality is that many sites are not working at that scale or affected by the drawbacks, so I think your Select fieldtype and it's simpler administration will be a welcome solution for many. Thank you for putting it together. I know you likely produced this fieldtype with an understanding of the compromises, so just wanted to highlight the considerations for others that may researching which solution to use in a given situation. I can certainly think of situations where I will use your fieldtype. Down into the actual fieldtype's code, I have a few suggestions for you: In your getInputfield() method, these two lines are not necessary: $inputfield->attr('name', $field->name); $inputfield->class = $this->className(); On my installation, the submitted values were getting stored with the "\n" as part of them. In your getInputfield() method, I recommend trimming the value before sending it to $inputfield->addOption(), i.e. foreach($options as $option) { $option = trim($option); if(!strlen($option)) continue; $inputfield->addOption($option); } When I edited a page with this fieldtype, it already had a value selected. I recommend adding a blank option at the top of the select so that the first value isn't automatically selected (again, in your getInputfield() method): $inputfield = $this->modules->get('InputfieldSelect'); $inputfield->addOption(''); // blank or unselected option In your sanitizeValue() method, you may want to consider adding something that checks that the value is actually one of the allowed options. This is optional, but just an extra if you want it. There is some overhead in doing it, so you may decide it's worthwhile or not depending on what you want. But here's one way you could do it: <?php public function sanitizeValue(Page $page, Field $field, $value) { // remove any leading/trailing whitespace $value = trim($value); // If value isn't present in the select_options string, surrounded by CRLFs or CRs then it's not valid. // We also allow for match at beginning/end of select_options, as well as optional spaces in the select_options string // before and after the CRLF/CR that separate the options in the string. if(!preg_match('/(^|[\r\n]) *' . preg_quote($value, '/') . ' *([\r\n]+|$)/', $field->select_options)) $value = ''; return $value; }1 point