Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Nicole

  1. Hi! I'm learning more about ProcessWire and PHP in general by practicing on the different modules. I created a test form using the SimpleContactForm module and just adding 1 text field, 1 image upload and 1 file upload field. I've alternated between just one or the other and having both uploads. Without the upload fields, the form gets handled correctly and is stored as a page, however when I add an upload field it returns the following error: Fatal error: Uncaught Error: Call to a member function path() on null in C:\xampp\htdocs\avanzademo\wire\modules\Fieldtype\FieldtypeFile.module:220 Stack trace: #0 C:\xampp\htdocs\avanzademo\wire\core\WireHooks.php(924): ProcessWire\FieldtypeFile->hookProcessInput(Object(ProcessWire\HookEvent)) #1 C:\xampp\htdocs\avanzademo\wire\core\Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\InputfieldImage), 'processInput', Array) #2 C:\xampp\htdocs\avanzademo\wire\core\InputfieldWrapper.php(961): ProcessWire\Wire->__call('processInput', Array) #3 C:\xampp\htdocs\avanzademo\wire\modules\Inputfield\InputfieldForm.module(155): ProcessWire\InputfieldWrapper->___processInput(Object(ProcessWire\WireInputData)) #4 C:\xampp\htdocs\avanzademo\wire\core\Wire.php(383): ProcessWire\InputfieldForm->___processInput(Object(ProcessWire\WireInputData)) #5 C:\xampp\htdocs\avanzademo\wire\core\WireHooks.php(823): ProcessWire\Wire->_callMethod('___processInput', Array) #6 C:\xampp\htdocs\avanzademo\wire\core\Wire.php(450): ProcessWi in C:\xampp\htdocs\avanzademo\wire\modules\Fieldtype\FieldtypeFile.module on line 220 I've been looking into the mentioned files but can't seem to find the exact error. I also looked through a couple of the posts already discussing similar issues in the forum but I can't quite pinpoint what would be a viable solution for this. If anyone can help point me in the right direction, I'd greatly appreciate it.
  2. What a coincidence, I was reading about those earlier today. Anyway, it's already been discussed here: http://processwire.com/talk/topic/2516-in-page-editing-createjs-createphp/ However, I would like to present you with PW's version of inline editing so far: Fredi. You can read more about it here: http://modules.processwire.com/modules/fredi/ In my personal opinion, Fredi will do the trick. My only concern is that it's still in beta (although I don't have the slightest idea why).
  3. I hadn't thought about the page tree, and that is absolutely useful (thanks for that). I did start incorporating the "quick links" for my mom's website. That way she could easily add new products (she doesn't like to click much). I have a similar dropdown that states: "New (insert name of product)", she just had to click that, add the picture, description and done. I think the quick links are great for specific jobs, so it fits each client's needs. So, kudos for this, I love it. I think what makes PW so awesome is that you can personalize the back-end to your needs, not just the front-end.
  4. @Soma, what would we do without your lessons?! I didn't know the difference and how to use them... now I have to recheck my code...
  5. Actually, I think $selectedthumbs->title IS the post's title... <?php if ($page->children) { foreach($page->children as $selectedthumbs) {
  6. Oh, since you said you wanted content, I assumed you wouldn't be using GitHub... About Concrete5, I was referring to what you meant by "Workflow", after reading your reply, I realize it doesn't really fit into this situation . Oh well, I'm pretty sure anything can be done using Processwire, too bad I'm not good at that, yet.
  7. I think you want something like this: http://www.concrete5.org/documentation/using-concrete5/dashboard/workflow/ It's not actually useful for me since I'm the only one editing websites, although I'm pretty sure collaborative teams will definitely need something like this.
  8. I love foreach()

  9. Hey Joss... you can actually "scroll" through the project images... there's also a little link that says "TOP" at the end of each project, maybe jQuery wasn't fully loaded or something... Oh and Georgson, your website looks awesome and loads pretty fast for me too...
  10. @Soma, thanks for that wonderful explanation. I was wondering why both methods worked, this makes a lot of sense. I'll be using the SQL Query version, then.
  11. I'm happy to announce both codes (Soma's and Ryan's) work. @Ryan, I don't know why, but counting the comments worked even without the database query (using only Soma's code)
  12. Thank you very much for this code Soma, I imagined it would have something to do with finding the pages, then getting the fields, but I had no idea about the 'status' and how to find the pending ones. Thanks again. Ryan, thank you so much... I would've never been able to sort out this part and surprisingly, I can make sense of it. Thanks for the query snippets and for ProcessWire. I'll test and post back to tell you how it worked.
  13. Hello again everyone, I'm creating a template with an easy-to-use front-end adminbar (basically says: "Edit Page", "New Page", "Add News", "Add Product") and to make it more "user-friendly" it has the editor avatar and name as well as the options for "Profile, Help and Logout". I wanted to use PW's Comments Fieldtype and found that it's possible to display comment count here: http://processwire.c...rns-odd-number/ and I also found that it's possible to check comments since the last visit here: http://processwire.c...nce-last-visit/ I am now wondering *if* it's possible to display the total comment *count* from all pages containing the 'comments' field. Basically like this: "Welcome Back admin, there are {$comment-count} new comments." and that would redirect to the Comments Manager module. I've looked around the forum but didn't find anything similar, and I'm not really good with PHP so I might've overlooked a function. Thanks in advance. EDIT: Can I use something like: $count = count($comment) ?
  14. @Pete and @Soma thanks for bearing with me. I realize that's similar to something you shared before Soma, an idea struck me but I guess I'm not getting anywhere with it. Yes Pete, you got it right, the code is outputted on the front-end and it does look like that, and yes Soma, they don't need to deal with the code since I'm the one outputting it. I guess I made PW difficult even though it's easy -- I just remembered something I read on PW: "Forget all that clutter you're used to dealing with in other CMSs"...
  15. OK, I might get that to work, is there a way to output the markup without making them edit code? For example, there's a field called "Number of Pages" that allows them to write an integer, and another one called "Parent Page" that allows them to select the page that will be taken as parent for the page list. Is there something like an existing fieldtype that can be added, takes the data from the previous fields and then outputs the markup?, I just noticed the "Markup" inputfield, could I use that? PS, let me know if I didn't explain it well, it makes sense in my head but I'm not sure it does here Wait, I think I might have something here....
  16. @Pete, hi Pete, thanks for helping. I wanted to create the module since some friends want to be able to add page-lists at will, simply by defining the parent-page and the limit of pages. Maybe it's because they're used to another CMS. And as Soma mentioned later, it's not meant to be a front-end form, the inputfields simply get the details then output them where I need them in the markup (or they're supposed to, anyway). @Soma, thanks for helping as well. After it didn't work I imagined it would be harder than I thought, maybe it's better to put this project on hold until I grasp PW's basics. Your solution could work well, although I was aiming to create back-end interface where users simply select the parent page, the limit and the code is outputted where needed, for ease of use (no code involved). But I think I'll show them PW is different and how they can make it even more awesome. Plus as @nik and @netcarver said, what a great explanation Soma, thanks for taking the time to deal with me. Thanks to all...
  17. I think the problem lies here: public function getConfigInputfields(array $data) { $inputfields = new InputfieldWrapper(); //ask for number of pages to display $f = $this->modules->get("InputfieldInteger"); $f->attr('name', 'numberofpages'); $f->label = 'Number of Pages to Display'; if(isset($data['numberofpages'])) $f->value = $data['numberofpages']; $inputfields->append($f); //parent page for children to be displayed $f = $this->modules->get("InputfieldPage"); $f->attr('name', 'parentpage'); $f->label = 'Display pages located beneath'; if(isset($data['parentpage'])) $f->value = $data['parentpage']; $inputfields->append($f); return $inputfields; } because if I simply use this code: public function getInputfield(Page $page, Field $field) { $inputfield = $this->modules->get('InputfieldPage'); return $inputfield; } or public function getInputfield(Page $page, Field $field) { $inputfield = $this->modules->get('InputfieldInteger'); return $inputfield; } everything seems to work fine, although I still can't get it to output anything but that must be an error, either in the echo on the template or on the field's output.
  18. Thanks for your help... It's a fieldtype module and might take longer to build than I thought... I want to retrieve the integer for "number of pages to display" and the page inputfield for "parent page of the displayed pages" then take those values and output the markup on the page. I wanted to make it a "markup" module but couldn't quite get how to insert it into a specific page. It's basically a "blog" or "page list" module. This is my code: <?php /** * * Copyright 2013 by Nicole Bardales * * * ProcessWire 2.x * Copyright (C) 2012 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://processwire.com * */ class FieldtypeBlog extends FieldType { public static function getModuleInfo() { return array( 'title' => 'Blog', 'summary' => 'Displays a Page List', 'version' => 1, 'author' => 'Nicole Bardales', 'href' => '', 'permission' => 'page-edit', ); } public function init() { } public function getConfigInputfields(array $data) { $inputfields = new InputfieldWrapper(); //ask for number of pages to display $f = $this->modules->get("InputfieldInteger"); $f->attr('name', 'numberofpages'); $f->label = 'Number of Pages to Display'; if(isset($data['numberofpages'])) $f->value = $data['numberofpages']; $inputfields->append($f); //parent page for children to be displayed $f = $this->modules->get("InputfieldPage"); $f->attr('name', 'parentpage'); $f->label = 'Display pages located beneath'; if(isset($data['parentpage'])) $f->value = $data['parentpage']; $inputfields->append($f); return $inputfields; } public function sanitizeValue(Page $page, Field $field, $value) { } public function BlogPageList($event) { $class = "page-list"; $limit = $data['numberofpages']; $page = $data['parentpage']; $results = $this->$pages->find("parent=$page, limit=$limit, sort=-date"); $event->return = "<ul class='$class'>"; foreach($results as $result) { echo "<li><h3><a href='{$result->url}'>{$result->title}</a></h3><p>{$result->summary}</p></li>"; } $event->return = "</ul>"; } } Thanks again
  19. Hello everyone, I'm new to ProcessWire, and (this may sound cliché but) it's awesome... I've only used it for 3 days and already modified some of the admin UI for ease of use and configured a toolbar. Today I was creating a module but I'm not really PHP-saavy, so when I got this error, I was pretty much stuck: Fatal error: Cannot instantiate abstract class Inputfield in C:\xampp\htdocs\processwire\wire\core\Fieldtype.php on line 79 This module uses the integer inputfield and the page inputfield, I noticed that on Fieldtype.php, line 78 says: "// TODO make this abstract" so I'm wondering if that could have something to do with the fact that it's not working or if there's something wrong with my code. Thanks in advance. //Nicole
  • Create New...