Leaderboard
Popular Content
Showing content with the highest reputation on 03/24/2013 in all areas
-
I managed to make this work For testing purposes, I'm using the drag and drop files in here span as a placeholder to paste the image from the clipboard and I marked it with a yellow background to make it obvious (I know it doesn't make sense, but it's just for testing). To paste the file just click on that span and ctrl+v or right click on it and paste from the context menu. It's late and I want to sleep, so no more explanations for today. But if you want to test all you need is to replace the inputfieldFile.js inside the inputfieldFile module folder by the file attached in this post. BE WARNED: THIS IS HIGHLY EXPERIMENTAL (but I think it won't blow your server) edit: I can't upload a .js file. Just change from .txt to .js or paste the contents edit2: made some corrections with a fresh mind, after sleeping edit3: changed some details on the code. The file is new InputfieldFile.txt5 points
-
Imagine a hotel website. Done? Yeah, most of them look the same ;-) In this project I took another approach. The client is - thank PW - able to (re)create the whole look of his website by changing tiles (images, sizes, texts). The size adapts to the screen size, so on nearly every device the look is different. But not the user experience. After one week online I can say: It works. Thanks to a lot(!) of image material and an engaged client it is one of the biggest sites I've ever made. There is a lot to discover (only german yet, english is due in May). So click around... Der Blaue Reiter - Design Hotel Karlsruhe3 points
-
Would be nice to be able to upload images from the clipboard. I investigated a bit how the image field could be extended with this and found some useful information here http://www.smartjava.org/content/copy-and-paste-images-your-browser-using-w3c-clipboard-api Turns out that we couldn't just catch a ctl+v command like in that example, because we have text area and other image fields where we might be pasting on the same page. The solution could be to create a hidden (opacity:0) element somewhere in the uploads box with the attribute "ContentEditable" (I tried, for intance, over the "drag and drop files in here" span) so we can use the paste entry in the context menu. Here is an example of how it can work https://github.com/JoelBesada/pasteboard/blob/master/assets/js/modules/copyandpaste.coffee from the source code of http://pasteboard.co/ You people think this might be usefull? Is it doable? edit: see the next post2 points
-
2 points
-
This has now been implemented (along with a bunch of other tweaks and quite a bit of code rewrite.) Message should be visible on all fields with no stored history rows. If there's exactly one row of data, it'll be visible in revision list, though naturally it'll be only entry there and always selected.2 points
-
2 points
-
Hello Ryan, In the introduction you write that there is an issue when using ProCache with the LanguageLocalizedURL module. Is this still an issue and if so when do you expect it will be save to use? Thanks BTW, and thank you and all contributors for making ProcessWire for what it is (and will be in the future). With Processwire I feel like starting to build what I want instead of first stripping what I don't want. I've tried several CMSs and examined how far I could get (with my limited coding capabilities) to make exactly what I want. Processwire is the first that hasn't stopped me and doesn't force me to make all kinds compromises.2 points
-
CKEditor for ProcessWire CKEditor is a web text editor like TinyMCE. This module can be used anywhere TinyMCE can be used in ProcessWire and it is generally considered one of the best web text editors out there. TinyMCE and CKEditor have always been the two big leaders of web text editors, and they've been equals for many years. Though lately it seems like CKEditor might be a little ahead of TinyMCE in some areas, so I thought we should give people the option of using CKEditor with ProcessWire. CKEditor has a nice inline mode that is desirable in the page editor when you may have lots of rich text inputs. The reason for this is that the page editor loads a lot faster. If you have this need, this would be one reason why you might want to use CKEditor over TinyMCE. Some also prefer CKEditor for other reasons. For instance, @apeisa prefers the table controls in CKEditor to TinyMCE's. Here are a few notes about this module: You already know CKEditor–it's what this forum is using. Though the version included with ProcessWire's module is significantly newer. It is currently beta test. You are advised to test thoroughly before using it in production. You may very well run into bugs, in which case please let me know so that I can fix. It is tested and confirmed compatible with both repeaters and multi-language support. It is now fully hooked into our link and image systems, like TinyMCE. Thanks to Antti for helping with the image plugin. If you want to use the inline mode, you'll need to install the HTML Purifier module first. The toolbar is fully configurable. It is multi-language ready and all text in the module is translatable. Like with TinyMCE, the module optionally supports definition of custom plugins and content.css file. How to install Copy all the files from this module into: /site/modules/InputfieldCKEditor/ Login to your admin and go to Modules > Check for new modules. Click install for InputfieldCKEditor. Now go to Setup > Fields and locate a textarea field that you want to use CKEditor (or create a new textarea field). When editing the settings for a textarea field, click the Details tab. Change the Inputfield Type to CKEditor and save. While still editing the field settings, click to the Input tab for CKEditor-specific settings you may optionally configure. Download ProcessWire Modules page: http://modules.processwire.com/modules/inputfield-ckeditor/ GitHub Repo: https://github.com/ryancramerdesign/InputfieldCKEditor Screenshots Screenshot of regular mode: Screenshot of inline mode, combined with multi-language fields:1 point
-
Module: MinifyHTML Simple module, didn't even plan to add it to the forum untill owzim asked me to. Description: This module takes the HTML output and then minifies it, and removes all comments from it but leaving the conditional comments in place. Usage: Just install, nothing to configure, works automatically. URL: http://modules.processwire.com/modules/minify-html/1 point
-
Hi Folks, On the PW download link: http://processwire.com/download/ the link to "download the zip file" comes up with PW 2.2.9. When you go to github, and click on the zip file link, it downloads as 2.3. I've downloaded both, and unzipped both, and the unzip directories are different. So... I used the github version, but I thought that since I'm just starting with PW, I should make sure that's the right one. Any thoughts on the differences? Thanks, Peter1 point
-
Thanks Ryan for the heads up, there's some nice examples for advanced coders. Strange. Now, I also would have thought that with !$u->getErrors() it wouldn't work, but it still does! I went and did many tests after you posted this and I can't see any difference and it all works as it should. The code works with both and I haven't looked into it further (core). I wish to be proven wrong but it really does (at least for me here) :/ I think you got a valid point with checking for if there's files really uploaded at all... However this wouldn't work if image upload would be not required in your form. Also the example you posted is also not showing how you could make required fields and inline error/repopulating fields, prevent CSRF and double posts. It's still a great example but as said, not a "complete" example that can be used in a public front-end form. May or may not suiteable for people not knowing what they're doing and only copy paste. What I also think could be the problem on Matthews side is that the PHP upload and post max size isn't enough to upload the file. I also tested this and it seems to fails silently with no errors and just shows the form again. Maybe there's a way to get around it, but thought it might be an issue since there's no error thrown as it's apache upload interrupting? --- It can get somehow complex to add all checks and validation to a form server side, and the following post example is also just for showing what all there's involved to make a pure php form (using some PW internals). Yet another example I've spent couple hours creating a form upload example - with files (images) upload to a page file field - adds new page on the fly and adds uploaded images - prevents CRSF attacks, this also prevents double post by refresh page after submit - has required fields with error messages inline - repopulates form field in case an error happened or a required field was not filled in - sanitizing and saving values to a page - jquery example with disabled submit button on form submit The gist repo can be seen here https://gist.github.com/somatonic/5233338 You can configure some variables and array's at the top and add remove fields as you wish to the html form markup. Like this: // --- Some default variables --- $success_message = "<p class='message'>Thanks for your message!</p>"; // --- All form fields as nested array --- // using html form field name => template field nam, from the page you're going to create $form_fields = array( 'fullname' => array('type' => 'text', 'value' => '', 'required' => true), 'email' => array('type' => 'email', 'value' => '', 'required' => true), 'message' => array('type' => 'textarea', 'value' => '', 'required' => true), 'newsletter_subscribe' => array('type' => 'checkbox', 'value' => 0, 'required' => false), 'images' => array('type' => 'file', 'required' => true) ); // --- WireUpload settings --- $upload_path = $config->paths->assets . "files/.tmp_uploads/"; // tmp upload folder $file_extensions = array('jpg', 'jpeg', 'gif', 'png'); $max_files = 3; $max_upload_size = 1*1024*1024; // make sure PHP's upload and post max size is also set to a reasonable size $overwrite = false; // --- Page creation settings --- $template = "upload-entry"; // the template used to create the page $parent = $pages->get("/uploads/"); $file_field = "images"; $page_fields = array('fullname','email','message','newsletter_subscribe'); // $page_fields = define the fields (except file) you want to save value to a page // this is for the form process to populate page fields. // Your page template must have the same field names existent // ------------------------------ FORM Processing --------------------------------------- include("./form-process.php"); To set this up. 1. Create a template upload-entry used to save the form submissions. With all the fields you'll have in the form, and name them the same as in the $form_fields 2. Create a form-upload.php template used to hold the form config and markup code: (create a template in PW with this name and the page the form should be rendered) https://gist.github.com/somatonic/5233338#file-form-upload-php 3. Create a form-process.php file in the templates folder with the processing code (This is included in the template file above after the configuration part) https://gist.github.com/somatonic/5233338#file-form-process-php There's a basic styling CSS: https://gist.github.com/somatonic/5233338#file-form-css And the jQuery snippet used to prevent double posting when double clicking the submit. https://gist.github.com/somatonic/5233338#file-form-js This is some screen showing the form:1 point
-
That is the end result. Biggest thing though is that it doesn't load those editors until mouseover. So if you have three textfields with five languages, it doesn't have to load 3*5 = 15 editors at page load.1 point
-
1 point
-
Ah, thanks That was because I originally had fields for both keywords and description, but decided to drop keywords since they are not often used now. Oh, and welcome to PW! Hope you get to like it as much as I have. You will see Matthew Scheneker on here too, who used Seblod and Joomla more than I did, so if you have any questions relating one to the other, ask away. Mind you, everyone else will probably join in anyway (they do that a lot round here) Joss1 point
-
Ryan, I don't think styles.js is about matching backend styles to frontend styles - it is about adding site specific "style blocks" with classes. Like CKEDITOR.stylesSet.add( 'my_styles', [ // Block-level styles { name : 'Blue Title', element : 'h2', styles : { 'color' : 'Blue' } }, { name : 'Red Title' , element : 'h3', styles : { 'color' : 'Red' } }, // Inline styles { name : 'CSS Style', element : 'span', attributes : { 'class' : 'my_style' } }, { name : 'Marker: Yellow', element : 'span', styles : { 'background-color' : 'Yellow' } } ]); http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Styles1 point
-
Hi there, Joss and thanks for recommending PW on the SEBLOD forums One small correction to the tutorial: In the section Creating the Article Fields, you create a field named article_metadescription, yet later on you use article_meta_keywords so the first mention should be changed to reflect the later ones.1 point
-
Actually that error message does make sense. Though this might be something that wouldn't behave the same way in all PHP versions. But it's something that should be changed in InputfieldCropImage either way. Starting on line 27 of InputfieldCropImage.module, can you change this: protected function renderItem($pagefile, $id, $n) { $out = parent::renderItem($pagefile, $id, $n); with this: protected function ___renderItem($pagefile, $id, $n) { $out = parent::___renderItem($pagefile, $id, $n); Basically, prepend three underscores "___" to the renderItem definition and call.1 point
-
I have to admit that I like learning from videos and books. They help to get across bigger picture concepts much better than copying and pasting. They build a foundation. So when it does come time to writing code (or copying pasting it), you've got the understanding of it. The problem with copying/pasting is that it's like building without a foundation, which can be dangerous. When you've got the foundation, all the other pieces just kind of fall into place. I think this is especially true of ProcessWire. If you understand the big picture and how simple it is, the rest of it becomes simple as well. And there's no reason not to learn the foundation, because it's so darn simple. It seems like a lot of people start working with ProcessWire while thinking of it in the context of some other CMS. So there is inevitable "un-learning" that has to take place, as people are looking for complexity where there isn't. This is a recurring theme. What I think would do an even better job of establishing the foundation would be two printable PDF documents that are maximum 1-printed page each: ProcessWire in a nutshell, a cheat-sheet – Covers everything you need to know to understand a typical site profile. Pages, Fields, Templates, then $page, $pages, and PageArray. All you need to know about PHP to use ProcessWire – This one would focus on the general PHP concepts necessary to use it like a template engine with ProcessWire. Covers things like PHP tags, double-vs-single quotes, echo, if(), foreach(), and comparison vs. assignment.1 point
-
I agree, and I actually have tried to implement this before. I could never get jQuery's double click event register and work here. I suppose it's because we are already using the click event. But if someone else figures out how to get both double click and click working for it, I think it would be worthwhile to have.1 point
-
Matthew, the primary problem I can see is this line: if(!$contact_photo->getErrors()) { The issue there is that getErrors() always returns an array, which always resolves to "true" in your if statement. In order for it to work properly, you would need to count() the return value of getErrors() rather than typecast it to a boolean like you are doing now. However, I don't think that getErrors() is a good way to check for success with WireUpload, because errors could occur while files were still uploaded. So it's better for your code to ask the question "were any files uploaded?" rather than "did any errors occur?". Then worry more about errors if no files were uploaded. There were also several other minor issues or concerns, but I think the issue mentioned above is the primary reason it wasn't working. I've attempted to re-factor your code and resolve all the issues/concerns that I would have had with it. This is written in the browser, so there may still be typos, but hopefully the intentions are clear: <?php /** * Process the contact form * * Populate's ProcessWire's $notices API var with errors and messages * * @return bool Returns true on success, false on failure. * */ function processContactForm() { $input = wire('input'); $sanitizer = wire('sanitizer'); // Set a temporary upload folder where the files are stored during form processing // RC: precede temp dir with a period to ensure it remains non-web accessible $upload_path = $config->paths->assets . "files/.temp/"; // RC: create temp path if it isn't there already if(!is_dir($upload_path)) { if(!wireMkdir($upload_path)) throw new WireException("No upload path"); } // New wire upload $contact_photo = new WireUpload('contact_photo'); // References name of HTML form field $contact_photo->setMaxFiles(5); $contact_photo->setOverwrite(false); $contact_photo->setDestinationPath($upload_path); $contact_photo->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif')); // execute upload and check for errors $files = $contact_photo->execute(); // RC: use count($files) as your decision whether to proceed not not, rather than getErrors() if(!count($files)) { $contact_photo->error("No files received, so not creating page."); return false; } // Save in the ProcessWire page tree; map submission to the template fields $np = new Page(); // create new page object $np->template = "contact_submission"; $np->parent = "/customer-service/contact-us/contact-submission-listing/"; // RC: for safety, only add user uploaded files to an unpublished page, for later approval // RC: also ensure that using v2.3+, and $config->pagefileSecure=true; in your /site/config.php $np->addStatus(Page::statusUnpublished); // Send all form submissions through ProcessWire sanitization or just map a variable // RC: No need to have intermediate variables, I removed them--populating the $np page instead $np->title = $sanitizer->text($input->post->contactname); $np->name = $np->title; $np->contactname = $sanitizer->text($input->post->contactname); $np->email = $sanitizer->email($input->post->email); $np->comments = $sanitizer->textarea($input->post->comments); // RC: assuming this is a textarea fieldtype $np->save(); // Run photo upload foreach($files as $filename) { $pathname = $upload_path . $filename; $np->contact_photo->add($pathname); $np->message("Added file: $filename"); unlink($pathname); } // save page again $np->save(); return true; } // First, confirm that a submission has been made if($input->post->contactname) { if(processContactForm()) { echo "<h2>Your page was saved!</h2>"; } else { echo "<h2>Sorry things didn't work out!</h2>"; } foreach($notices as $notice) { $class = $notice instanceof NoticeError ? "error" : "message"; echo "<p class='$class'>$notice->text</p>"; } } else { // display contact form }1 point
-
Hi guys! here is my first published site made with ProcessWire: http://max-cafe-bar.de The design is not mine but Erika's, I only adapted it to the screen and made all the changes needed for being responsive to screen sizes. I'm aware that it is extremely slow... the server is where they had the old site hosted, and since the PW back office is also acting very slow, I'm assuming It has something to do with them. Anyone from Germany has any experience with strato.de?1 point
-
Seems like a good approach to me. You should use $page->name for the IDs instead of $page->title, because it will strip the spaces and any character that is not allowed on IDs. Maybe this is even the reason why your jQuery scrolling is broken. Doesn't seem bad to me, but you may prefer repeaters for this.1 point
-
It took me a while but I now have a working example of something that resembles the setup above. I didn't quite get the concept initially that in processwire a page doesn't actually have to be a page, it can just be a data container for my code. Once I got that I managed to put the site together, see code below. Hopefully this will give others a few pointers too. I'm not convinced it's necessarily the best interpretation so it would be great to get advice on this. My homepage code is like this: <?php include("./header.inc"); /** * Homepage template * */ $items = $page->children; foreach($items as $item) echo $item->render(); include("./footer.inc"); ?> As this is a one page website and pages aren't actually physical pages, this allows me to pull in data from child pages of my homepage. My page template looks like this: <div class="page"> <div class="header" id="<?=$page->title?>"> <a name="<?=$page->title?>"></a> <!-- Any content I want in here --> <?php foreach($page->children as $child) echo $child->render(); ?> </div> </div> I wanted to create dynamic navigation. In one page websites the navigation is setup with ID's so the <?=$page->title?> reference allows me to set up whatever page title I want in the backend and have it pulled in as the target for my navigation. Setting up the navigation was fairly straightforward. I based it on Ryan's tutorial here , the code is very similar, I just added href="# and removed the url reference. <ul class="nav"> <?php $root = $pages->get("/"); $children = $root->children(); foreach($children as $child) { echo "<li><a href='#{$child->title}'>{$child->title}</a></li>"; } ?> </ul> I did run into a small problem as I'm using jquery's scrollTo plugin on the links. My original code looks like this and the jquery breaks most likely due to conflict with the php. I originally had this in my footer scripts and changed it over, can't quite remember why off the top of my head but there was a good reason from memory. I also need to get the "active" class working. Any idea how to rewrite/handle this? <ul class="nav"> <li class="active"><a href="#page1" onClick="$.scrollTo( '#page1', 800 );">Home</a></li> <li><a href="#page2" onClick="$.scrollTo( '#page2', 800 );">Page 2</a></li> <li><a href="#page3" onClick="$.scrollTo( '#page3', 800 );">Page 3</a></li> </ul> Moving back to my page template I have the line <?php foreach($page->children as $child) echo $child->render(); ?> This allows me to pull my module code blocks into any page just by assigning a module template to the child page. The structure is the same as my first post but here's where it gets slightly complicated. My modules most of the time span the full width of the page however I also have a few cases where a module just becomes a simple div container and smaller sized code blocks/widgets are positioned within the module itself. It looks something like this: Header Page1 Module1 Submodule 1 (1/3rd width of container) Submodule 2 (2/3rd width of container) Module2 Page2 Footer The above is just an example but I could have 3 submodules within a module block. As they can be in any combination and position it wouldn't make sense to write all the possible combinations in a module block. At the minute to solve this I have a module container with the same php line that's in my page template to pull any submodule content into the module block. While this works I'm not convinced this is the best solution because from the users point of view they have to navigate through the page hierarchy to edit specific blocks rather than all the blocks relative to a page being on that page in the backend. I know I could call in the module templates to my page template with php but that's not very friendly from an admin point of view because it requires editing the main page template each time the module structure needs changed. What's really needed is a way of hiding the module/submodule child pages from the user and pulling all the blocks into their parent page for editing in the backend. Any advice would be greatly appreciated.1 point
-
Look at the error. Something with your selector is wrong. The limit has some whitespace that is not allowed. Should be limit=10.1 point
-
@diogo: LOL! Couldn't believe my eyes... this bar is about 500m from my home ;-) Saw the site by accident some months ago and thought: Cool, a nice website for a café I know, that doesn't happen that often Nice work! (And yes, forget Strato, it is a desaster).1 point
-
Try opening the permissons on the /site/modules/ and /site/assets/ directories. http://modules.processwire.com/modules/modules-manager/1 point
-
Newb here, obviously by the title above . Searched a while as I was having the same issue as nellone. Just so others will know, the above solution will also work in wamp. Looking forward to working with pw as potentially my new go-to cms.1 point
-
@arjen: I've tried to replicate this in my setup without any success. I'm also running PW 2.3.0 and have been testing this with a template with plain textarea, TinyMCE, CKEditor, alone and in all kinds of combinations, but still can't see any problems. What you're describing there definitely sounds like the bug that was just fixed, but I can't really see why that would still happen, unless you've got an old version of VersionControlForTextFields.js on your site. Could you check that said JS file includes a typeof check for tinyMCE? If that's not the case, this would probably be the cause of this and solution would be to update that JS file too. If it does seem like latest version, I'll need to do more debugging to find another situation where this could happen1 point
-
Mark, I think the source of your confusion here is that you still don't understand how PHP works. Unlike other programming languages, PHP can integrate with HTML in two ways: by integrating it, or by being integrated inside it (ok, strange sentence, but I hope it delivers the point). these two do the same thing: <?php echo "<h2>" . $page->title . "</h2>"; ?> <h2><?php echo $page->title; ?><h2> The difference is that, in the first code you are telling PHP to output all the content, while in the second example, you are using it to output only the dynamic content between static content. The important thing to understand (and this was your mistake), is that you start the file outside PHP, and then you can enter it with "<?php" and leave it with "?>". You can never open a PHP tag, when you are already inside another, like here: <?php <-- we opened PHP include("./TUT_header.inc"); echo "<h2>" . $page->title . "</h2>"; <?php echo $page->body; ?> <-- and we opened it again without having closed it before You should read an introduction to PHP to learn all these concepts, and you will see that PW will be much easier then.1 point
-
Greetings bongomania, One of the things that makes ProcessWire so amazing is how easy it is to link data at all levels with your styling/output concepts. As diogo shows, displaying your results in a table is easy. And you can get really fancy without too much more effort. I'm working on a project now where the client wants to be able to sort various fields of data, and I am using the JQuery DataTables plugin: http://www.datatables.net/index With this plugin, you can "foreach" through your pages as table rows, and then loop through fields in each page as table data, and make them sortable and styled beautifully. Starting from there, and the possibilities grow and grow... Thanks, Matthew1 point
-
Brilliant plugin! Works great locally but online i get the following error. Seams like something is missing on my server? Anyone have a clue? Fatal error: Call to undefined method InputfieldImage::renderitem() in /var/www/hobbyimage.com/site/modules/InputfieldCropImage/InputfieldCropImage.module on line 29 Short info of my online server PHP Version 5.2.4-2ubuntu5.10 Client API version 5.0.51a GD Support enabled GD Version 2.0 or higher FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.3.5 Locally PHP Version 5.3.5 Client API version 5.5.9 GD Support enabled GD Version bundled (2.0.34 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.4.4 Could it be something with the gd2 lib? Im running pw 2.21 point
-
Hello Ryan, I think I found it. Whenever I forget the trailing slah, it redirects. So https://ssl-account.com/neu.bigair.tv/admin/ works (even though no stylesheets or anything is found) but https://ssl-account.com/neu.bigair.tv/admin redirects to https://ssl-account.com/admin which of course doesn't work at all. I'll try to get this to work with that. Thanks! thomas1 point
-
In PW the best way is to think of each repetition of data as an individual page. The best approach in your case would be to create a page "table" and have the rows as children pages of that one. those pages would have their own template "row" (names are just as example) wish would hold all the fields that correspond to your columns. Everytime you want a new row on the table you just have to create a new page as child of the "table" page. To convert these pages to table rows in the frontend is as easy as this: foreach($pages->get("/table/")->children as $row){ echo "<tr><td>{$row->field1}</td><td>{$row->field2}</td><td>{$row->field3}</td><td>{$row->field4}</td></tr>"; } This is only one part of the answer, but I have to go now... hope it gives you some light.1 point
-
Hi Mark, You're too kind. I am not a PHP bod by any means. Coming from tag-based cms's like EE and Textpattern has been a bit of a struggle but oh so worth it. If it wasn't for the patience and help of everyone on these forums I would probably still be struggling. The first site I worked on was my own and the code has gone through a few revisions as I learn new things. You're right, I learned from things not working, asking questions and a little perseverance. I still have much to learn. I can't exactly remember how I started learning the code - it was probably trial and error for sure. The same principles apply to PW as they do to other systems when it comes to getting lists of entries/pages. It time permitted I'd could bang on about how much more flexible PW is compared to anything else I've used. Building a site in PW is second nature to me now to the point where I don't even look at any other system. I just know what I have to do to make it work - most of my sites a pretty straight-forward though. If you want to know about anything I've built - as in how it works - just let me know. @diogo: Send me a duck post card Regards Marty1 point
-
1 point
-
I haven't given up on this, and I came quite far. It's been a couple of months since I worked on it - last couple of months have been kind of hectic for me, so I haven't made any recent progress. I do want to work on this, and still believe it's possible - since I gave up on using $trackChanges, the approach I'm using should be pretty safe. Probably a couple of weeks of work left on this at least though, and not sure when I'll get back to it...1 point
-
On the github page it also still says "ProcessWire 2.2 stable" in the short description on the top.1 point
-
Yes, I have used Joomla for years and am abandoning it. My first sites were made with the Geocities site builder (1998 ish?), then hand coding, and eventually Dreamweaver. What disappointed me most about moving to things like Joomla and Wordpress was the loss of the design control I had with Dreamweaver, but I wanted the overall site management I got with the CMS. The joy of ProcessWire for me is that I can move back to to that Dreamweaver/raw coding design control (which is so much faster) while still retaining the power of a CMS. I dont have to design while worrying whether I can actually make this work in Joomla. Once you think of it in that direction, once you realise that PW is not restricting your basic layouts, then it all becomes much, much easier!1 point
-
Good Day, I wanted to express my greatest appreciation for the fine work you put into creating the Bootwire basic framework and demo profiles. I've tried both and they installed without any problem. I myself also come from the Joomla world to ProcessWire and had been extremely happy to have found my way here. My only problem had been understanding the relationship between ProcessWire and markup. In the Joomla world, working with markup is totally different. I was struggling to make the connection and it didn't help that there are only a few profiles to look at. It was your helpful explanations regarding how Twitter Bootstrap integrated with ProcessWire that cleared up my confusion regarding this. I was able to look at both profiles and now the lights are finally coming on inside my mind. I am enjoying using ProcessWire once again. Thank You. Best Regards, Charles1 point
-
Hello my PHP addicted friends Since I see so many struggling with JS (read: jQuery) in the forums, here is a good learning resource via Cody Lindley's twitter http://superherojs.com/1 point
-
hey i'll add to the rant @totoff - you mean themeforest i think ? i think the prefabs are necessary for some devs and users, and for certain projects; I'm a sworn PW user, but i have a site running joomla because there is a really good invoicing system called nBill; and some CMS have advanced prebuilt addons (a.k.a. plugins/modules/components etc..) like community, calendars etc.; so you have to do research and consider budgets before you choose the cms for the project. When you can use PW you'll be relieved, it has the best admin UI hands down of any CMS. i just got done converting a wordpress template, one that I liked a lot, to use in a processwire site – it was really educational; i was able to see how the wp theme was coded and it wasn't a pretty site. Tons of code bloat (but all necessary to make the theme usable to a wide audience); and then i was able to go and attain all of the functionality of the wordpress version and more using 1/20th of the code; and i'm able to do really cool things now with the content management, media (audio, video) that would be completely impossible in WP, or would be a ridiculous hack job...1 point
-
I've been making good progress here on ProcessWire 2.2 which we're targeting for the end of the year. The main drive of this version is adding multi-language support to the admin. This multi language support is being sponsored by Avoine, thanks to Antti Peisa. I just wanted to outline the approach we're taking as well as get any feedback and suggestions you have. The direction taken with multi language support is based on conversations Antti and I had a few months ago as well as feedback from users in the forum. What ProcessWire 2.2 focuses on There are lots of components to supporting multiple languages in a CMS, and the area we're focused on with this version is supporting multiple languages for PW's admin, modules and 3rd party modules. This is so that your clients can make edits to their site without having to know English. While PW hasn't had specific multi-language tools for your front end, it can support multiple languages any number of ways there (as many users have done, with language trees, multiple fields, etc). But the back-end tools have always been in English without an obvious way around that. So the biggest need has been a way to support multiple languages for PW's admin tools, core modules, 3rd party modules, etc. Basically, the non-dynamic side. And that's what PW 2.2 tackles. The direction being used We originally looked at PHP's gettext tools (http://www.php.net/manual/en/book.gettext.php), as they've been successfully used to provide this capability for CMSs like WordPress and Drupal, and they are a ready-to-go solution that is built-in to PHP and adds multi language capability with little overhead. I like gettext() from the PHP side as it's a really easy solution (for coding at least), and it's really efficient from the PHP side. But I felt that it puts a lot of burden on the translators with a lot of technical jargon, file formats and other tools. I want the translation tools to have the same simplicity as the rest of PW, and it looked like that was going to be a hard sell with gettext. Instead, we're using a home-brewed solution that essentially does the same thing as gettext, but is a whole lot simpler for translation. It's simple enough that if you find something that needs translation, you can just go and edit it in PW like you would edit anything else. It also means that these tools will be very simple for 3rd party module developers to use. They will also have use in your own sites and templates for your non-dynamic content. The tradeoff is that it takes longer to code this way (for me) and that it can't possibly be as efficient as gettext (given that gettext is built-in to PHP). Translations take up memory. However, PW, doesn't have files with tens of thousands of lines of code and doesn't need to keep thousands of translations in memory at any given time. When it gets down to the needs of PW and the needs of those using it, I don't believe we'd ever benefit from the efficiency of gettext. So the home-brewed solution won out. The actual solution is coded as a module. So if you don't need anything other than English in the admin, then you'll just leave the 'Languages' module uninstalled. How it works from the admin side The Languages module will be provided with the core, ready for a 1-click install. As soon as you click 'install', a 'Languages' tool is added to your Setup menu, a 'language' template is added to your templates, and a 'language' field is added to your fields and appended to the 'user' template with the default language (English) selected. When you go to Setup > Languages, you'll see a list of languages that are installed. From here you can click to edit a language or click 'Add New' to add a new language. Each language is technically a page (just like with users), so you can add additional fields to the 'language' template should it suit your needs. By default, each language template has a name (ISO-639 code, i.e. 'en'), a title (i.e. 'English') and a 'translations' file field. Each file in this field contains translations for a file in ProcessWire (whether a module, core, template, etc.). These files are created by another module in ProcessWire (to be discussed below) but a files field is provided here so that you can easily share your translations with other people. Likewise, you'll be able to download new language packs from the ProcessWire site and just upload them here, ready to use. How to make a translation ProcessWire keeps track of language translations on a per-file basis. So if you want to translate a file in ProcessWire, you have to tell it which one. ProcessWire will then load the file into memory and look for function calls that indicate translatable text. Then it presents you with a screen of all the phrases it found for translation, along with inputs for providing a translation for each one. See the attached screenshot for an example of this. When you hit 'save', it saves those translations in a JSON file that PW's languages module uses for runtime translation. This JSON file can also be shared with others, distributed with a module you've created, or zipped up with others as part of a language pack. As soon as the English version native to the translated file changes, the translated versions are considered out of date. We don't want to make guesses about the scope of the text change. So your translation screen will show you any existing translations that are considered 'out of date' along with new entry fields to provide new translations. Any fields left blank on the translation screen are considered untranslated and thus the original language (English) is substituted for any untranslated phrases. How it works from the code side I mentioned earlier that I like how gettext works from the developer side, and ProcessWire works in a very similar manner in this regard. Meaning, indicating text as translatable involves a "_" function call followed by the text. ProcessWire also needs a context, so you call this function with '$this'. Here's an example: $value = $this->_('Add New Page Here'); So $this->_('text') identifies the text as translatable. You have to use $this->_('text') rather than the gettext format of _('text') for two reasons: first is that the _('...') function is native to PHP and actually calls gettext, so that's already taken! Second is that ProcessWire needs a context to the function call… it needs to know what class or file it was called from, otherwise all translations would be a global namespace. So ProcessWire figures that out behind the scenes with a context of the calling class and uses the Reflection API to determine the file. If you didn't understand that last sentence, then don't worry because you don't need to–ProcessWire is taking care of the technical details for you. In addition to the $this->_('text') you can use a function format that would most likely be more suitable for translations performed in your template files. In this case, because "_" is already taken by gettext, we use "__" like WordPress does. So you can do this: echo __('Submit Form'); ProcessWire figures out the context of that call automatically and groups the translation with others from your template file. This type of call can also be used in 3rd party modules, but you'll have to tell PW the context, i.e. <?php echo __($this, 'Submit Form'); // these two lines do exactly the same thing echo $this->_('Submit Form'); Best practices for pre-translated text Just like with gettext, when entering text that's ultimately going to be translated, you need to avoid putting in any dynamic things in it. For instance, a string like "Found $count products" is not good for translation because it contains a variable in it. Instead, you'd want to enter such a string as: sprintf("Found %d products", $count). For more details, see the 'Marking Strings for Translation' and 'Best Practices' sections in WordPress's i18n page. They use gettext, but the same applies to us: Marking strings for translation http://codex.wordpress.org/I18n_for_WordPress_Developers#Marking_Strings_for_Translation Best practices http://codex.wordpress.org/I18n_for_WordPress_Developers#Best_Practices New API variables The Languages module installs a new API variable called $languages. It's interface is identical to that of $users in that it can be iterated as a PageArray or you can use get() and find() calls to pull individual languages from it, i.e. <?php foreach($languages as $language) { echo $language->title . "<br />"; } …and… <?php $french = $languages->get('fr'); The Languages module also adds a $language variable to every $user. So you can check what the current language is like this: <?php if($user->language->name == 'es') echo "Hola!"; Of course, $language is just a Page object, so it will also contain any other fields you have added to your 'language' template. Because ProcessWire's native language is English, the language is assumed to be English by default. So if you want it to assume a different language by default for your site, then you would just edit the 'guest' user and select a different language. Next Steps So that's the current state of ProcessWire 2.2 and how it's multilanguage support works. But it's not the only part of it. Because ProcessWire's admin is itself a site developed in PW, and because PW's output is not all non-dynamic, we need multilanguage support in our dynamic fieldtypes and inputfields in order to be truly multilingual. This is what I'll be focusing on in November, so will have more updates on that side of it then. Of course, this side may also be useful for the front-end (your sites) too, though my feeling is that a multi-tree approach is better for accessibility and SEO even if you do have multilingual fields. But even with a multi-tree approach, having multilingual fields will no doubt be useful with shared assets and more. I'm also hoping to have a beta version ready for those that are interested in testing within a month (or in the next few days, if interested in testing before multilingual fields are in place). Please post your questions, suggestions, feedback, etc. This is a work in progress and nothing is set in stone. Edit: added 'New API variables' section.1 point