Leaderboard
Popular Content
Showing content with the highest reputation on 11/14/2012 in all areas
-
(Note: Module name temporary and will change) As recently mentioned here I am recently working on a little module. This module gives you a new admin page under "Setup" to create pages in a "batch" mode. What does it do - You can select a parent page where you want to create your pages. Then it will give you a list of templates you can chose from. Those should be permission and template setting aware. Also only parents that really can have children will work, else it will give an alert. - Add as many pages you like by clicking "+add Page". You can set the pages published or hidden status. Sort or remove the pages. - After you entered a template and at least a title you'll be able to klick "create Pages". If successful it will append the list of pages you just created with an open in page tree or edit link, and also the parent. - You can add pages and repeat the process to add pages to the pages you created simply by changing the parent page in the field above the table and go on. It's all ajax and not page load. Also the links of the created pages that get appended below will stay in the document and only the form entries get cleared. This is still work in progress, but I thought enough to share and if you like you can try/test/use it. Download: ProcessTools.zip Screen:10 points
-
Assign edit access to individual users on a per-page basis The user must already have page-edit permission on one of their roles in order to get edit access to assigned pages. Otherwise, they will only gain view access. This module is fully functional as-is, but intended as a proof-of-concept for those wanting to go further with adding custom edit and/or view access. The main functionality in this module consists of only a few lines of code, so it should be a simple edit for anyone wanting to take it further. If you make some useful additions to it, please post them. How to use Create a new role called "editor" (or whatever you want to call it) and give the role "page-edit" permission. If you already have a role in place that you want to use, that is fine too. Under "Access > Users" locate the user you want to assign edit access to. Edit this user. For this user's "Roles" field: choose the new role you added, "editor" (or whatever you called it). For this user's "Editable Pages" field: select one or more pages you want them to be able to edit. Save the user and you are done. To test, login as the user you edited to confirm it works how you expect. http://modules.processwire.com/modules/page-edit-per-user/ https://github.com/ryancramerdesign/PageEditPerUser4 points
-
Nevermind. I just figured this out on my own. Apparently, I just needed to change the field "Summary" to allow it to use TinyMCE and remove text formatting and now she works like a charm just like an excerpt field. Did I mention I love ProcessWire?3 points
-
I think the Modules Manager should be part of a core.3 points
-
In Middle Earth with "open source cms" ProcessWire is on #2 when logged in, and on 4th page #1 if logged out. Through there's not many using PW her in Middle Earth except Gandalf who still needs to finish the orks.me.2 points
-
Thanks Adam, I'm trying to put the points forward and put PW's name out there! http://www.andregoldstein.co.uk/blog/why-more-often-than-not-i-use-processwire/2 points
-
2 points
-
Hi, I just uploaded the first version of the SchedulePages module to Github: https://github.com/f...r/SchedulePages This plugin module allows you to schedule (un)publication of pages. I hope you guys will like it. //Jasper Usage: ====== Place the SchedulePages.module file into the site/modules folder and install the plugin from the admin area. Install/activate the LazyCron module (if you haven't already). This module is part of the Processwire core, but it isn't activated by default. Add the following date fields to your template: publish_from publish_until Note: the fields are already created during the installation of the module That't all. LazyCron will run take care of (un)publishing your pages that have a the publish dates set. It will run on every hour. Please note: LazyCron hooks are only executed during pageviews that are delivered by ProcessWire. They are not executed when using ProcessWire's API from other scripts. Edit: Changed the name of the module and function as Ryan suggested below. Edit 2: Updated instructions. Required fields are now automatically created and from now it runs every hour. Edit 3: Added module dependency. The updated module is on Github1 point
-
EDIT: This project has been put on ice - I don't work with ProcessWire in my day job anymore, so this project is looking for a new maintainer. Knowing that, you can decide whether it's worthwhile reading through 7 pages of posts EDIT: The source code has been dumped on GitHub - feel free to fork and have at it. There's one thing about ProcessWire that pains me, and I've brought this up before - it's the same problem I have with e.g. Drupal... Because the meta-data (Configuration, Fields and Templates) is stored inside the database, once you have a live site and a development site, moving changes from the development site to the live site is, well, not really possible. Repeating all the changes by hand on the live site is simply not an option I'm willing to consider. Telling the client to back off the site and give me a day or two to make the changes, and then moving the whole database after making and testing the changes on a development site, is really a pretty poor solution, too. I had heard some talk about a module in development, which would make it possible to import/export Fields and Templates? It sounds like that would mostly solve the problem. Ideally though, I'd really like a solution that records changes to Fields and Templates, and allows me to continuously integrate changes from one server to another. So I started hacking out a module, but I'm not sure if it's going to work at all, if it's even a good idea, or if it's worth the effort. I'm looking for feedback on the idea as such, more than the code I wrote, which isn't real pretty right now. Anyway, have a look: https://gist.github.com/b7269bb7bd814ecf54fb If you install this, create a "data" folder under the module's folder - migration files will be written there. Basic overview of the idea and code: The module hooks into Fields::load() and takes a "snapshot" of the current Field properties and settings on start-up. It also hooks into ProcessField::fieldSave() and when a field is saved, it compares it's properties and settings to the snapshot it took at startup - if changes were made, it writes the previous name and updated properties into a file. The same thing is not implemented for Templates yet, but would be. The migration-files are named like "YYYY-mm-dd-HH-mm-ss.json", so that they can be sorted and applied in order. Each file contains a JSON representation of a method-call - currently only updateField() which would repeat a previous set of changes and apply them to another installation of a site. (not implemented) So basically, the module would record changes to Fields and Templates, and would be able to repeat them. How those files get from one system to another is less of a concern - would be cool if servers could exchange migrations semi-automatically, using some kind of private key system, but initially, simply copying the files by hand would suffice. I'm more concerned about the whole idea of capturing changes and repeating them this way. Any thoughts? Is this approach wrong for some reason? Would this even work?1 point
-
Just launched this site a few minutes ago. It's not totally done, as I've still got some detail work to do, but figured it was at a good point to share: http://www.houghtonacademy.org I did the design and development on this one. Like the blog profile, this one uses the Skeleton responsive CSS framework. Though I went a lot further with the media queries on the mobile side than I did for the blog profile. So you should see a nicely optimized layouts for tablets, mobile portrait and mobile landscape. So far only tested on iPhone though. Many of the graphics (though not all) are also optimized for Retina displays. When you get to the homepage, you should get a different photo and tagline on every page load. Highlights (in terms of ProcessWire development): Faculty Directory: http://houghtonacade.../about/faculty/ The data for the faculty directory is updated once daily and it pulls from a service called Veracross, that manages all their school systems. They are all represented as pages in ProcessWire, so the client can add unique biographies and such that aren't present in the service it pulls from. Form Builder is used throughout the faculty directory to power the individual employee contact forms. Events Calendar: http://houghtonacade.../news/calendar/ The events calendar uses jQuery plugin FullCalendar and it pulls from a ProcessWire-powered JSON feed. ProcessWire gets the data from a Veracross feed a few times a day, caches it, and creates a new feed specific to use with FullCalendar. The events data is also used on other pages in the site, such as the homepage. Photo galleries: http://houghtonacade...f/photogallery/ There are several photo galleries throughout the site, and they use the Photoswipe jQuery plugin, which is really great when using mobile as it duplicates the behavior of using the built-in iPhone photo gallery. Thanks to Soma for recommending this back in another thread. Video pages: http://houghtonacade...out/headmaster/ These are powered using the TextformatterVideoEmbed module and are responsive (per the latest update to this module).1 point
-
Does anyone know what it would take to create a SimpleScripts installation script for ProcessWire. The list of existing applications you can install on your server hosting with just a couple clicks is here: http://www.simplescr...com/script_list It would be awesome to see ProcessWire listed there to be able to use. My web host Bluehost has those scripts installed, WordPress fires off without a hitch, and you can install a fresh install in just seconds. Some of the others the configuration maybe needs tweaked, and are not quite as foolproof. thanks!1 point
-
That worked, thank you sir! Now, because I wouldn't want you to think you could stop using your brain for two seconds, I have a new question. I also just tried adding some code for sharethis.com (sharing buttons) but it appears I'm editing the wrong files because I can't get it to work. Their site tells me to add this code at the bottom of the post: <span class='st_sharethis_hcount' displayText='ShareThis'></span> <span class='st_facebook_hcount' displayText='Facebook'></span> <span class='st_googleplus_hcount' displayText='Google +'></span> <span class='st_twitter_hcount' displayText='Tweet'></span> <span class='st_linkedin_hcount' displayText='LinkedIn'></span> <span class='st_email_hcount' displayText='Email'></span> so I assumed I'd add it under this chunk of code in /site/templates/markup/post.php: <div class='post-body'> <?php if($small) { echo substr($page->summary, 0, -4) . "… <a class='more' href='{$page->url}'>" . __('View More') . "</a></p>"; } else { echo $page->body; // if the post has images and no <img> tags in the body, then make it a gallery if(count($page->images) && strpos($page->body, '<img ') === false) include("./gallery.php"); } ?> </div> It then tells me to add this code into my site header: <script type="text/javascript">var switchTo5x=true;</script> <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script> <script type="text/javascript">stLight.options({publisher: "c29ec199-09ee-40fc-ae3d-746c240bb69a"});</script> so I edited the file /site/templates/head.inc and put it here: <!-- This website is powered by ProcessWire CMF/CMS. ProcessWire is a free open source content management framework licensed under the GNU GPL. ProcessWire is Copyright 2012 by Ryan Cramer / Ryan Cramer Design, LLC. Learn more about ProcessWire at: http://processwire.com --> <script type="text/javascript">var switchTo5x=true;</script> <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script> <script type="text/javascript">stLight.options({publisher: "c29ec199-09ee-40fc-ae3d-746c240bb69a"});</script> </head> This does not appear to work, however, and nothing loads. What am I missing?1 point
-
Ah sorry I was looking in the wrong place. It looks like I missed a closing quote on that meta tag: Change this: <?php if($page->summary) echo "<meta name='description' content='" . strip_tags($page->summary) . " />"; ?> To this: <?php if($page->summary) echo "<meta name='description' content='" . strip_tags($page->summary) . "' />"; ?> Does that fix it?1 point
-
Problem solved - hurray !!!! I opened up the local Modules.* cache files in my IDE. One of them listed the following: _FormBuilder/FormBuilder.module _FormBuilder/ProcessFormBuilder.module FieldtypeCropImage.module FormBuilder/FormBuilder.module FormBuilder/ProcessFormBuilder.module GazleyHelperModule.module Helloworld.module InputfieldCropImage/InputfieldCropImage.module PageLinkAbstractor.module ProcessCropImage/ProcessCropImage.module ProcessExportProfile/ProcessExportProfile.module TextformatterResponsiveImages.module I can't believe it. The last time I updated FormBuilder to the latest version, I renamed the original one with an underscore, so, _FormBuilder. This is a habit of mine. Whenever I replace files, I tend to rename the original with an underscore so I can easily go back to it, if I need to. PW was processing FormBuilder twice! It also choked with the Paginator module that I replaced ages ago with my own version containing some changes that are in the Dev branch. I don't know whether Ryan's changed something recently but I haven't seen any problem with PW inadvertently processing underscore prefixed files until now? Any way, I'm in business! I went to the remote server and deleted the _FormBuilder folder and the site fired up instantly. It seems that the DB problem was a bit of a red-herring. I'm so pleased! Thanks to everyone who has offered me advice, tips and support. I really appreciate you guys! Thanks!!!!1 point
-
I was actually thinking of adding a "Tools" menu to ProcessWire admin (in addition to Pages, Setup, Modules, Access). The reason for it is that we've now got a lot of tools that don't necessarily fit the definition of "Setup", so thought it might be handy to come bundled with another place like that. PW1 had such a Tools menu like this.1 point
-
Yeah, essentially a dropdown where you could make some (basic) changes without actually having to open up the page. That and any batch processes, it's all going to help speed up developing in the back end. Just idea though, it's already a great addition1 point
-
PW 2.3 protects file-based assets to unpublished or non-public pages, so this won't be a concern much longer. Matching up names is just one way to do it. I just put together a quick module that provides another way you could do it even more easily:1 point
-
You can count me in - I'm still under 100 posts myself but I've been reading almost every single post for a half a year now. I'd like to see the figures for Finland without visits from the three of us.1 point
-
In Finland ProcessWire is second last on page 2 with "open source cms". Maybe even the fact that the server is on US might affect? "Custom fields cms" => 1. result "php cms" => last on 2. page Soma is from Middle-earth.1 point
-
Great module Soma! Tested it out and worked nicely. Only thing I'm wondering about is the name: ProcessTools? How about something that better describes what it does, like ProcessPageAdder or ProcessBatchPages or something like that?1 point
-
1 point
-
Something I discovered with this profile (which I'm almost done implementing by the way) is that if you insert an image into a post and resize the window, sometimes the image overlaps the right sidebar. I used a neat CSS trick to make my images, regardless of size, automatically resize with the windows. Here is the CSS: img { max-width: 100%; height: auto; width: auto\9; /* ie8 */ } This makes things nice and neat.1 point
-
<!-- Members Template --> <?php if ($user->isSuperuser() OR $user->hasRole("editor")) { $members = $page->children(); if ($members) { echo "<ul>"; foreach ($members as $member) { ?> <li><a href="<?php echo $member->url; ?>"><?php echo $member->title; ?></a></li> <?php } echo "</ul>"; } } else { throw new Wire404Exception(); } <!-- Member Template --> <?php if ($user->isSuperuser() OR $user->name === $page->name) { ?> <h3>Hi <?php echo $page->title; ?> Welcome back</h3> <?php if ($page->images) { ?> <h5>Here are your images</h5> <?php foreach ($page->images as $image) { ?> <img src="<?php echo $image->url; ?>" alt="<?php echo $image->description; ?>" /> <?php } ?> <?php } ?> <?php } else { throw new Wire404Exception(); } <!-- Login Template --> <?php $out = ""; $form = " <form action='./' method='post' id='login_form'> <label for='login_name'>Username</label> <input type='text' name='login_name' autofocus> <label for='login_pass'>Password</label> <input type='password' name='login_pass'> <input type='submit' id='submit' name='login_submit' value='login'> </form> "; if($input->post->login_submit) { // process submitted login form $name = $sanitizer->username($input->post->login_name); $pass = $input->post->login_pass; if($session->login($name, $pass)) { if ($user->isSuperuser()) { $session->redirect("../members"); } else { $session->redirect("../members/$name"); } } else $out = "<h2>Login failed, please try again.</h2>"; $out .= $form; } else { $out = "<h4>Please sign in, in order to view your profile page.</h4>"; $out .= $form; } include ("./header.inc"); echo $out; include ("./footer.inc");1 point
-
I think it just depends on the needs of the site. I'm guessing every site will have a little bit different needs. I tend to veer towards keeping no 3rd party modules installed for my starting point, and then install them as I need them. The ModulesManager might be the best candidate to have installed since it'll make installation and upgrades of any other modules a piece of cake.1 point
-
Uploading 20 images in single field: 2secs Creating 20 pages and adding one image per page: 5minutes1 point
-
1 point
-
1 point
-
Yes, method should be post. Since you will be submitting to the same page, all the code will go on the same template. You might want to do this as the action: <form id="orderForm" action="<?php echo $page->url ?>"> Now we have to test for the submission of the form. This test can be used also inside the form to output errors. I will use the radio button for this, since it will have a value for sure if ($input->post->premium) { // form was submited. Here is where we will collect all the information }else{ // you don't have to use the else, but here is the place to output something for when the form wasn't submited } // form should go outside the if statement To collect the information we will have to know where to send it to. I don't know if you decided on those things but, are you going to create a page for each transaction? Or a page for each client? Here I will assume you will want to save a page for each transaction. For this you will have already prepared, a template "transactions" with all those fields (customer_name, email, quantity, addons, premium), and I will assume that you will have all the transaction as children of the page "/order/". if ($input->post->premium) { // create a new transaction page $tr = new Page(); $tr->template = $templates->get("transaction"); $tr->parent = $pages->get("/order/"); // fill the fields with the collected and sanitized info. See here about sanitation in pw [url="http://processwire.com/api/variables/sanitizer/"]http://processwire.com/api/variables/sanitizer/[/url] $name = $sanitizer->text($input->post->customer_name); $email = $sanitizer->email($input->post->email); $quantity = (int) $input->post->quantity; // (int) makes sure that the input is a number $add_ons = $sanitizer->text($input->post->addons); $premium = $sanitizer->text($input->post->premium); $tr>of(false); // this was wrong on my fist post. must be false $tr->customer_name = $name; $tr->customer_email = $email; $tr->quantity = $quantity; $tr->add_ons = $add_ons; $tr->premium = $premium; //save the page $tr->save(); // send the email to you $subject = "new buy"; $message = "{$name} bought {$quantity}. His email is {$email}"; mail('youremail@example.com', $subject, $message); // here you can redirect to a confirmation page, or to the same page for another buy } // code for the form This was only the basic. You should also perform some validation in the php code, and check if everything is ok before creating the page. The most common way is to use a errors array.1 point
-
1 point
-
Thanks Soma, batch editing is definitely a useful feature to have on board. I wonder whether it may expand one day to offer like a Quick Edit in WP though to be fair it's already very useful as it is!1 point
-
Sounds very useful. Will the module allow to remove bunch of pages with one click after marking them (with checkboxes for example)?1 point
-
1 point
-
You are thinking well here. Repeaters were created for a small number of repetitions. For a less predictable amount that justifies paginating would be better to use normal pages. In your case, you would have a page "testimonials" as a child of "our customers" and each children of "testimonials" would be one testimonial. The template for those pages would have the fields that you put on the repeater. foreach($pages->find('template=testimonial') as $testimonial) { echo "<blockquote><p>{$testimonial->testimonial_body}</p>"; echo "<small>{$testimonial->testimonial_customer}</small></blockquote> "; echo "<hr>"; } edit: It's also good to add that you are not forced to create a template file for all templates. In the case of the testimonials pages, if you are not planning to display them individualy, just create their template without a corresponding file, and their URLs won't be accessible in the browser.1 point
-
Sorry, something went wrong (in my head) posting this question. Thanks for your answer, I have bought the formbuilder, an amazing tool worth it's money!!1 point
-
As a brief answer before getting perhaps a more complete one from one of the more advanced PW crew If each user had a login and also their own page under say a template "client", you could make sure that only they can see their general client page by checking if their $user->name and the $page->name are the same, if it is, you are safe to output their content as only they will get to see the page content. Something like: if ($user->name === $page->name) { // show all the pictures and other member stuff } else { throw new Wire404Exception(); } This is all quite basic and you could turn on urlSegments so that you could have gallery on an additional page. Again only those who have the credentials to get to the client page will see the pages beneath it. I've used this method to create whole member areas, if you're interested I'll share with you what I did. In terms of the actual images that will be stored somewhere in assets/files/... you'll want to protect them somehow (unless protecting through obscurity is enough for your purposes) but will have to let one of the more advanced users advise on this. EDIT: To sum up, you could have the following page tree: Home About Clients (clients template) -- Joe Bloggs (client template) -- Jane Bloggs (client template) One thing that can get annoying is having to make sure you're creating both the user and the page and that they share the same name. As my editor was the person adding clients, I made a simple front end template for them to add clients through which created the user and the page at the same time. You could also just extend the built-in user template to add images and use that but I've found that in the long run having non user pages is more flexible for outputting data.1 point
-
Him again!! One day we should replace him by a real Tiny http://www.scriptiny.com/2010/02/javascript-wysiwyg-editor/ (38kB)1 point
-
The Form builder is great for building forms easily and quickly, but for a one time form it's not that difficult to make a customized one that plays along pw fields with great flexibility. It's really just a matter of building the form as you want in html, and selectively save the submited information in each field with the pw API: $page->of(false) $page->product_id = (int) $input->post->id; $page->quantity = (int) $input->post->quantity; $page->client_address = $sanitizer->text($input->post->address); ... $page->save() The price update you can do with jQuery. I prepared something very simple to show how http://codepen.io/anon/pen/apBmI The thing that can be more difficult is the payment, but all depends on what system or systems you will choose. If you choose paypal for instance, it can be as simple as having a submit with the address that they supply to you, and receive a confirmation of payment done. It's not my intention to make it look very easy (it's not), but it's not as difficult as it might seem. edit: corrected from $page->of(true) to $page->of(false), thanks to onjegolders.1 point
-
Is there anywhere that we can donate to Ryan as thanks for his work? Not only has he built an incredible system here but he is both helpful and humble in his interactions with us. Even if there is no plans for a donation function I just wanted to say thanks.1 point
-
Looking great. What do you guys think of the profile supporting mobile devices? Perhaps responsively. Also wondering if there might be value in building the profile from a framework like HTML Kickstart?1 point