Jump to content

Pete

Administrators
  • Posts

    4,056
  • Joined

  • Last visited

  • Days Won

    67

Everything posted by Pete

  1. I was thinking the same thing only yesterday I don't think you actually have to do much other than create some XML files from what I was briefly reading through, which doesn't sound too painful - depends what the contents have to be I guess.
  2. I scroll just because I forget what can be done with the API and sometimes it's handy if you can't think of what a particular function might be called (prime example was me looking for $page->images-getRandom() when images is just an array like most other things and I found it by scrolling through).
  3. Aside from that feature you need, how thoroughly incomplete is it? I've honestly not had time to check it out yet for more than a casual browse so I'm genuinely interested in hearing your thoughts. I moved from Avactis to Interspire and traffic to the store I converted increased tenfold. Avactis is (or rather was at the time) pretty poor SEO-wise and seemed slower than Interspire, and I'm with you on the tables. Just the jump in traffic showed me that the move was a great decision, and Interspire's admin is much better and faster to work with. Of course Interspire support is non-existent so again I can't really recommend them, unless you want to try their SaaS version - BigCommerce (but I still wouldn't recommend it as they ditched hundreds of Interspire Shopping Cart owners and haven't updated the Interspire website in... well... a really long time). Back to Lemonstand and it does look like someone has created a module to do what you're after: http://forum.lemonstandapp.com/topic/1284-stock-by-product-attributes-the-ol-tshirt-issue/page__p__6681__hl__variations__fromsearch__1#entry6681 Apparently advanced inventory is on the roadmap too. Again, I'll stress I've not used Lemonstandapp or really had much time to look into it, but it seems like more than "pretty CSS" to me.
  4. Awesome to hear - be sure to post a link when it's up!
  5. Well I mentioned those colours as they're currently used for success/error messages in the system. They can of course be changed via CSS. The main point I was getting at was to try and use CSS that's already part of jQuery UI for simplicity.
  6. The other option is to do a normal menu and if it's ONLY those two pages you don't want to appear then exclude them using the API selectors.
  7. For 1 you could just use a textarea and have each new array item on a new line, or separated by a comma, and then explode the array in the template to read it - so essentially a field that's acting like a CSV list. For 2, I think what you're after is what's been discussed quite a lot here: http://processwire.com/talk/index.php/topic,53.0.html It's also on the roadmap for version 2.4: http://processwire.com/about/roadmap/
  8. It might even be simpler if it's just colour-coded. Red for abandoned, green for new? Anything to make it stand out really.
  9. Added mine just now (after I leasrned how to use GitHub - didn't want to be the only one not using it ). Hopefully I didn't undo/overwrite any or ryan's edits on the spreadsheet as I've no idea how Google Docs handles multiple simultaneous editors!
  10. You can change the search to include hidden pages: $matches = $pages->find("title|body|sidebar~=$q, limit=50, include=hidden ");
  11. Hehe, I was replying as you were replying. The cheatsheet did indeed hold the answer but for some reason I was originally trying to search for "images" on the cheatsheet before I remembered it would be an array anyway (oops). I blame the horrible cold I've currently got impacting on my brain's ability to think straight
  12. Never mind - I forgot PW allows you to do this instead to get $n random images. $a->getRandom($n) Code is now as follows and works perfectly: $homepageimgs = $pages->get("/")->images; $imgarray = $homepageimgs->getRandom(3); $resizedimgarray = array(); $i = 0; foreach ($imgarray as $img) { $scale = 262/$img->width(); $resizedimgarray[$i] = $img->size(262,round($scale * $img->height())); $resizedimgarray[$i] = $img->size(262, 149); $i++; }
  13. Hi folks I'm trying to grab 3 random but unique images from the images field on a website's homepage. Here's my code so far which does a bit of iteration, thumbnailing and cropping: $homepageimgs = $pages->get("/")->images; /*foreach ($homepageimgs as $k => $v) { echo $k; }*/ $imgarray = array(); for ($i = 0; $i < 3; $i++) { $imgarray[$i] = $homepageimgs->getRandom(); $scale = 262/$imgarray[$i]->width(); $imgarray[$i] = $imgarray[$i]->size(262,round($scale * $imgarray[$i]->height())); $imgarray[$i] = $imgarray[$i]->size(262, 149); unset($homepageimgs[$imgarray[$i]->name]); } The issue is that I want 3 unique images, so I need to remove whichever random image is selected during each iteration from the $homepageimgs array so it can't be randomly selected again. Sadly that last line of code returns an error. Any ideas? I was pretty sure the filename is also the key (as evidenced during the 3 lines of commented-out code). I also tried unset($homepageimgs->$imgarray[$i]->name); which is probably ridiculous, however my OO PHP knowledge is severely lacking hence why I tried it anyway
  14. up - useful if you have a section for documents, or a section for downloads etc so it's easily identifiable as to what the section's content is (although it should be obvious anyway it's always nice to have additional visual indicators).
  15. Indeed - I just assumed everyone knew already
  16. I just used the CheatSheet for the first time last night - I'd gone from an HTML template to an almost-completed website in 2 hours! This is a testament to how well this cheatsheet is laid out as much as it is to ProcessWire's ease-of-use, but the CheatSheet saved me having to look around for things and every minute saved soon adds up
  17. Nodes was the one that just popped into my head, but every time I think about it it would just make it more confusing to name them something other than pages, especially to an average user such as a business owner who just wants to be able to update their pages. --- I did have a slightly-related thought - why not change the "Pages" link in the admin to "Content", and allow the wording for a "page" to be changed on a per-template basis? That way you could have a template called "Products" and tell that template to call each child page a "product" instead? It's not a necessity by any means, but might make the workflow feel more... "right"
  18. Very nice! Some very neat javascript but not too over-the-top, and overall a nice layout and navigation. Good work!
  19. Not that it's much help, but wouldn't a better way be to leave the tree in-tact and instead just remove the Edit link for any page they can't edit? Perhaps somehow highlighting the pages they can edit? The only reason I mention that is because if you forget to give them access to the parent page of the one you want them to be able to edit then they won't be able to get to that page. I'm very interested in this by the way if you're creating a module from it?
  20. Very useful indeed - thanks!
  21. I can't speak for everyone, but I think most of us started with just the basic install. There are a few important things to read if you haven't already - the major one is the templates section on this page which will tell you how to actually output the content you're adding to the admin area into your template files when a page is loaded in the browser: http://processwire.com/api/templates/'>http://processwire.com/api/templates/ Assuming you haven't read it already, this entire section is worth reading: http://processwire.com/api/
  22. I think there would need to be more documentation actually written before that could be done - beyond the API docs I mean.
  23. If it's an option for any of you, this is quite good (aside from occasional crashes): http://www.my-debugbar.com/wiki/IETester/HomePage
  24. Not sure whether it will help you, but the database connection is kicked off in wire/core/ProcessWire.php around line 90 with this code: if($config->dbSocket) { $db = new Database($config->dbHost, $config->dbUser, $config->dbPass, $config->dbName, $config->dbPort, $config->dbSocket); } else { $db = new Database($config->dbHost, $config->dbUser, $config->dbPass, $config->dbName, $config->dbPort); } Wire::setFuel('db', $db); I'm not sure how you would set up another connection inside a module or template, as I doubt you would have access to the Database object, but something like this might work at the beginning of the template (untested): $mydb = new Database('localhost', 'username', 'password', 'db_name', 3306); or maybe (again, untested): $mydb = new Wire::Database('localhost', 'username', 'password', 'db_name', 3306); If either works let me know. The idea would then be to use $mydb instead of $this->fuel('db') for the queries.
  25. And the fact that your username has to be lowercase (gets me every time that one ). On that note, could you change the error message or give some more indication that it has to be lowercase ryan? That or change it so if you put in a mixture of uppercase and lowercase it doesn't error and instead just changes it all to lowercase behind the scenes and carries on. Back to the topic, I get what diogo is saying - sometimes it's handy for beginners to see just how easy something is so I was thinking about a very quick write-up with the relevant screenshots to help illustrate just how quick and easy it is. Some systems I've used are surprisingly less straightforward.
×
×
  • Create New...