Jump to content

ryan

Administrators
  • Posts

    17,090
  • Joined

  • Days Won

    1,638

Everything posted by ryan

  1. Thanks Jeff -- glad that Dictator has been working well for you. The problem I'm having with some other Dictator sites is that the clients don't seem motivated to upgrade. Going and working on 7+ year old code so isn't fun, even if it's still functional. But I sure wish I'd put Dictator out there as open source back in 2003. Get in touch next time you are passing through the city of Decatur. I'll get the second round.
  2. I just emailed you a link to download the skyscrapers site profile/installation if you want to take a look at it.
  3. Thanks. Since this is a PHP 'notify' error, I'm guessing you have $config->debug set to true? These notifications should be suppressed if debug is false. Though I usually keep debug on during site development, and off for production. This particular error looks like one that is good to know about though, because it seems to indicate a value that shouldn't be there. If that's the case, it needs to be fixed, so I will keep an eye out for it too.
  4. Great -- looks like it works well!
  5. I'm confused by the field/page names -- is the name of the field "sliderat" or "slider1"? But lets assume there is a field named "images" on the page "/mypage/" and you wanted to pull a random image, like in your example: You'd do it like this: <?php $mypage = $pages->get("/mypage/"); if(count($mypage->images)) { $image = $mypage->images->getRandom(); $thumb = $image->size(400, 200); // if you need a thumbnail // then output the thumbnail and/or image like in previous examples } Also, you had mentioned templates in a context that I'm not sure I understood. Templates define a type. You don't pull data from a template, but from pages that use that template. So think of templates like the database schema for a table, and pages like the rows of data in that table.
  6. Not sure about this one then. Haven't seen that particular error message, and it doesn't seem to make sense, at least not on the surface... but I will look at it again in the morning. Let me know if you see it occur anywhere else. Thanks, Ryan
  7. Glad that worked! It does sound like the PageListSelectMultiple is the right choice for your needs. If it needs to traverse a tree and there are hundreds of possible options, then this is the best bet. We'll also be adding an autocomplete page selection fieldtype at some point, which could be useful here as well.
  8. Have you added a field named 'collapsed' in your system? It looks like I need to add that to the reserved word list, but just wondering if that's the issue here...
  9. I fixed this problem on Jeff's server and wanted to reply here to follow up on what the issue was. The problem involved the URL starting with a "~", like this: /~theameri/process/ Apparently Apache needs the RewriteBase directive set in your .htaccess file if you are using this style of "~" URL off of your domain. And it needs to be set with the part that includes the "~" (something that we didn't cover earlier in the thread). So on Jeff's server, with PW installed in the /process/ directory off of his web root, I set the RewriteBase directive in the .htaccess file like this: RewriteBase /~theameri/process/ If it weren't installed in the /process/ subdirectory (and installed in his web root), it would be this: RewriteBase ~/theameri/ There were two other problems in the PW code that also prevented the "~" URLs from working: 1. PW's htaccess doesn't send any URLs with invalid characters to ProcessWire. I had to add the optional "~" at the beginning of the request URI in the .htaccess so that it would still send that to PW. This has been committed to the source. 2. PW's method of determining the root URL was also not compatible with "~" URLs. I changed it to determine it from $_SERVER['SCRIPT_NAME'] rather than $_SERVER['DOCUMENT_ROOT'], and this has also been committed (not sure why I didn't do this before!). So that's what the issues were, and hopefully we've got this figured out so that nobody else runs into it in the future. Jeff--thanks for your patience in troubleshooting this and helping me to resolve it.
  10. Jeff, dns stuff should not matter... PW doesn't care. But I am curious to see if it works at root ( without the ~theameri part). I got your email with the phpinfo, and it looks perfect, I can't find anything wrong there. This is quite a mystery. If you want to set me up with a shell or FTP access, I can go in and solve it hopefully. Malheur is great stuff btw.. Finally got around to trying it the other day, and think I'm going to have to enjoy another once we figure this out.
  11. Jeff, do you have a phpinfo() page? If not, upload a test.php to your server with this in it: <?php phpinfo(); Look at the result. See if it says anything about mod_rewrite. It really sounds like mod_rewrite is inactive or not working.
  12. Jeff, One other thing to try: Open your .htaccess file and paste a bunch of random characters at the top, like "alkjzb0983t093ozjvozubzb" Load your site. You should get a "500" Server Error. If not, then Apache isn't reading your htaccess at all. To fix that you may need to edit your httpd.conf file (/etc/httpd.conf, /usr/local/apache/conf/httpd.conf, or equivalent). To do that, edit the file and locate your <VirtualHost> directive for the domain where you've installed PW. Add a line within that directive: AllowOverride All You might also just want to do that for the whole server, as it's kind of expected in a hosting environment to be able to use .htaccess files and other things. So you could locate your <Directory "/">: <Directory "/"> Options All AllowOverride All </Directory> I'm not an expert on Apache configs. Just found this has worked for me in the few situations where I've run across servers that weren't reading htaccess files.
  13. So a user named 'needmore' was throwing duplicate entry exceptions? ;D
  14. For some reason I don't have this enabled by default. But here's how you do it: 1. Go to 'Admin > Modules' and make sure that the 'Inputfield > PageListSelectMultiple' module is installed. 2. While still in 'Admin > Modules', click on 'Inputfield > Page' and add 'PageListSelectMultiple' to the list of allowed Inputfields. Save. 3. Edit your Page field and change the Inputfield to the one you just added. Save. Let me know if that does it? The PageListSelectMultiple Inputfield is great for two situations: 1. Where you want to be able to select from multiple pages that may live at different parts in the tree hierarchy. This Inputfield can traverse the tree hierarchy just like PW's PageList. 2. Where the number of selectable options is too much to be reasonable for use with checkboxes or asmSelect. This Inputfield supports pagination of selectable options, just like PW's PageList. The place where I use it most often is in my homepage template where I want to be able to select a few "featured" pages on the site, and I want to be able to select any page, anywhere in the site. I couldn't do this in a scalable manner with any other inputfield. The only other way to accomplish it is to add a "featured" checkbox to all my page templates, and $pages->find('featured=1') to get them (which also isn't a bad solution). The situation you described makes me wonder if this is the best inputfield, because you only need to support two different types (distributors and products in your projects template), and your code will have to differentiate between the two in your template. Assuming you select a single 'distributor' and multiple 'products', and that product pages are children of distributor pages, an alternate approach might be to split it in two fields that are in your 'projects' template: - distributor: Page (single using select) - products: Page (multiple using asmSelect) The parent page for the 'distributor' field settings would be '/distributors/' or whatever it is in your site. For the 'products' field, you would use the "Alternate/custom code to find selectable pages" option in the field settings. And you'd paste in something like this: return $page->distributor ? $page->distributor->children() : new PageArray(); That basically says to return the distributor's children as selectable pages if there is a distributor. Otherwise, return a blank PageArray. Not sure if this is totally applicable to your needs, but just wanted to provide it as an example of what the "alternate/custom code..." option does, just in case it does suite your needs better.
  15. Gena, Glad that you got it working! With the line that generated the error, you can add a check like this to make sure the field is populated: if($slide_page->video_poster) { $img = $slide_page->video_poster->width(300); } With fields that have multiple images, you can perform a check like this: if(count($slide_page->images)) { $img = $slide_page->images->first()->width(300); } I am thinking about adding a 'default image' option to the image fieldtype so that you can optionally have it use a default image when not populated. That way, you wouldn't ever need to perform the if() statements in your code.
  16. That is the intended use. Fieldset will group multiple fields together for editing ease. If you use the FieldsetTab it will place them in a separate tab in the editor (like children and settings). Both can be nested as much as needed. I work on a couple sites that have 50+ fields in a template. So grouping of this sort becomes important. For sites that don't deal with a lot of fields, these fieldtypes will likely not get much use. These fields don't have much use outside of the admin, unless you needed to perform some kind of grouping on the front end.
  17. Gena, thanks for your feedback and glad you like ProcessWire so far. I think Adam had great suggestions. Of those he mentioned, my first thought is something about your php version or configuration. If you want, pm me a link to your phpinfo. Or, if you prefer, try installing a blank copy of processwire to your server. The installer should notify you of any potential issues and workarounds.
  18. Jeff, Open the .htaccess file in a text editor. Around like 70, you'll see this: # ----------------------------------------------------------------------------------------------- # Optional: Set a rewrite base if rewrites aern't working properly on your server. # ----------------------------------------------------------------------------------------------- # RewriteBase / # RewriteBase /pw Uncomment one of the lines above, and set it to your RewriteBase. Try: RewriteBase /process/ or RewriteBase /~theameri/process/ Not sure that'll solve it, but it's worth a try.
  19. I think he means the one from this video: http://processwire.com/videos/page-fieldtype/ I am not at a place where I can test here, but will test and reply a little later when at my desk. Thanks, Ryan
  20. Line 46 won't work because that line only gets executed if you are booting PW from elsewhere. You'll need to do it after line 46, like like 48. Try this on line 48: $rootURL = '/~theameri/process/'; Let me know if that does or doesn't fix it. Once we find a way to fix it, I should be able to find a way to fix it in PW so that other people on a similar server setup don't run into the same issue. Though this appears to be a little bit different issue than we've seen before, but it appears to be a PW issue not a server one. As for mod_rewrite, the installer checks to make sure it's installed. If it didn't give you an error about mod_rewrite not being installed, then you should be good.
  21. Adam had an idea and preference for making PageEdit return to PageList after saving, and he posted a snippet to make it happen in the FAQ section (thanks Adam!). I followed up with an alternate way using a module (something that won't get wiped out during upgrades). Posting again here since this is the Modules forum so the original topic can stay in the FAQ forum. Also thought this was a good example of how to make a simple module to customize ProcessWire for your preferences. Once installed, every time you save a page, it'll return to the PageList drilled down to the page you were editing. Some people prefer this behavior (though I'm not one of them). To install, paste the following (or download the attached module) into /site/modules/RedirectPageEdit.module. /site/modules/RedirectPageEdit.module <?php class RedirectPageEdit extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Redirect PageEdit', 'version' => 100, 'summary' => 'Redirects PageEdit to return to PageList after save rather than edit again.', 'singular' => true, 'autoload' => true, ); } public function init() { $this->session->addHookBefore('redirect', $this, 'myRedirect'); } public function myRedirect(HookEvent $event) { if($this->process == 'ProcessPageEdit' && preg_match('{^\./\?id=(\d+)$}', $event->arguments[0], $m)) { $event->arguments = array($this->config->urls->admin . "page/?open=$m[1]"); } } } RedirectPageEdit.module
  22. Adam, good tip. The only potential problem I can see here is that when you upgrade that update will get wiped out. Here's a way to do it in an upgrade-friendly way. Paste this into a file called RedirectPageEdit.module in /site/modules/. Or download it from the thread in the Modules forum (I'm going to post the file there). /site/modules/RedirectPageEdit.module: <?php class RedirectPageEdit extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Redirect PageEdit', 'version' => 100, 'summary' => 'Redirects PageEdit to return to PageList after save rather than edit again.', 'singular' => true, 'autoload' => true, ); } public function init() { $this->session->addHookBefore('redirect', $this, 'myRedirect'); } public function myRedirect(HookEvent $event) { if($this->process == 'ProcessPageEdit' && preg_match('{^\./\?id=(\d+)$}', $event->arguments[0], $m)) { $event->arguments = array($this->config->urls->admin . "page/?open=$m[1]"); } } }
  23. Thanks we could definitely use help with the Spanish translations. I hope to be at the point in a few weeks where we can start plugging in new translations, and I very much appreciate your help.
×
×
  • Create New...