Jump to content

Pete

Administrators
  • Posts

    4,035
  • Joined

  • Last visited

  • Days Won

    66

Everything posted by Pete

  1. It's a good read My thought though would be to make it personal if these end up on the new PW site - write them as customer succes stories rather than 3rd person case studies (which would just mean re-wording it to the 1st person in this case). What do you guys think?
  2. I did that - it started spitting out data in a seemingly endless loop - looked like the current page data over and over again.
  3. The source of the error appearing at the beginning of my code was a PageAutocomplete field with a custom selector - template=template1|template2 that was set to: "Single page (Page) or empty page (NullPage) when none selected". Presumably this shouldn't return an error though when viewing the page edit screen? The message goes away now when I change it to "Single page (Page) or boolean false when none selected", but I'd prefer it to be a NullPage that's returned as my code is already set up to use that. That's one thing solved, but it still won't let me upload images on the live server (which I suspected would be the case since it does locally ).
  4. I like this module as it reminds me of WayFinder for MODx - definitely one of the most useful tools I used to use for getting a site up and running quickly.
  5. Mine seems identical: foreach($this->value as $page_id) { $page = $this->pages->get((int) $page_id); if(!$page || !$page->id) continue; $out .= $this->renderListItem($page->get($this->labelFieldName), $page->id); } It turns out that that same text does appear in the source on my local server, but I can successfully upload images on my local server (same code - synchronised all the files today). I guess that they're two unrelated issues in that case? Oh, just spotted this weirdness in Firebug (the two errors are obviously it trying to upload the image). Not sure why that URL would throw a 404 as that's obviously the page I'm viewing - unless of course it is prepending my error message above to any JSON output?
  6. That would be nIce, I agree, but not too simple the way the module currently works. Now that PW has per-field settings for the same field on different templates I can see how something like that could work - I just have no idea how to code it
  7. I've got the same issue on one of my servers What I have noticed, and I can't pin this down, is that I have the following error before any other page output in the admin when I'm editing a page and viewing the page source: <br /> <b>Notice</b>: Trying to get property of non-object in <b>/home/mysite/public_html/dev/wire/modules/Inputfield/InputfieldPageAutocomplete/InputfieldPageAutocomplete.module</b> on line <b>78</b><br /> I only mention it as I've not been able to track down what that is (uninstalled all but the base modules) and I wonder if this output is interfering somehow? It's worth noting that the site is an exact replica of my local copy and image uploads work there so it's more likely the environment. I'll grab a phpinfo() output and PM you ryan.
  8. Welcome fellow MODx user As someone who's migrated a few sites to PW from MODx already, and is in the process of converting a site with dozens of template variables/snippets and hundreds of pages from MODx to PW, I'll echo what's been said above to some degree: You won't need PHP in the back-end. It's a bold claim as I don't know what TVs you had set up, but if you would like to post a few examples I'll be happy to show you how to do them in PW. The hardest part is unlearning whichever CMS' you've used previously - I still find myself looking for more complex solutions when there are perfectly easy ways to do things in PW. Overall, ditching my snippets in favour of creating more readable code inside templates (with good old-fashioned includes) and not having to use TVs, my code has been reduced dramatically in terms of length and is easier to read. So... not sure where I was going with this - but yeah, if you'd like to give an example or two of how you use TVs now then we can show you the PW way.
  9. I won't be first, as the one I'm working on has been in production for well over 3 months now, but I reckon I can post the first one about a gaming magazine style site
  10. I love it when that happens - happened to me with something the other day (although it was half an hour to do something I thought would take half a day - same principle). It certainly starts to make up for those frustrating times when running into coding roadblocks - those tedious ones where the answer turns out to be easy, but only after lots of time and swearing - I much prefer it when it happens this way around
  11. Thinking about it, I'm not sure why I didn't just do that instead. Oh well
  12. I think that these links would be incredibly useful in the admin interface when adding pages. It is annoying when you just want to add a dozen pages to one section and you have to keep going back to the page list, especially when your structure is a few levels deep and it takes a while to animate. I'm not complaining about the animation though - that's perfectly highlights where you are in the tree, but it does break the workflow a bit when adding lots of pages.
  13. Plus they've still got that hosting company advertised all over it which puts me off for other reasons. Just makes them look even less impartial to be honest. Welcome to ProcessWire cspeeds - if you have any questions just ask away
  14. Pete

    Cloudflare

    I like both of those. I'd seen Cloudflare a while back but never read enough to understand what the benefit was. Okay, so you can minify your JS and CSS yourself relatively easily enough, but one of the things Cloudflare seems to do is do it for you, as well as hosting all your JS, CSS and images in geographical areas closer to the end user. Whilst I agree there would be little point for most small sites, one site I have has over a hundred articles and most of them have screenshots with them. The new version of the site will also be a bit graphics-heavy in terms of the design. Therefore I can see the point there as you don't want a gallery to take a while to load and then have to wait ages from clicking on a thumbnail to seeing the larger version of the image. It does look like it could take some tweaking though so it doesn't cache things you don't want it to. New Relic also looks excellent for a different reason - if it works as per the video then it can help point out performance bottlenecks based on what content people are viewing most That certainly sounds excellent and takes a lot of the guesswork out of troubleshooting what can often be annoyingly hard to find issues. Kudos to both companies for providing a free version, though I can't immediately see what New Relic's free version offers.
  15. I think something like what you've linked to there diogo may already be on the cards for the future. I do really like how they've laid that out over at Symphony so maybe something similar to that would be good - I do like the way I looked at the page and thought "yep, that would be pretty easy to do in PW" and already had myself thinking about the code behind it. Definitely makes a change from other systems I've used where it would be more a case of "I wonder if this is possible?"
  16. That's kind of what I'm trying to do, but hide the thumbnail links when they're not needed to avoid confusion - that's what this next bit of code would do
  17. I've seen that sort of thing too Antti with an online shop - they had folders A-Z with each page storing files randomly in subfolders inside one of the letter folders, but your example is much better as it allows to scale a lot further, is far more logical and is a lot easier to program (I don't mean that this would be easy to implement, but it removes the random element I just mentioned in the other software I'd used). ryan - Antti's suggestion above does make a lot of sense although it sounds a bit crazy if you've never dealt with that many pages before, but even if you were getting to a more comfortable 20,000 pages it would make sense. I think the thing to think about with this many pages is how various programs interact with files and folders. There are a lot of different web server setups that can run PW, but they probably all have some sort of limit in this regard which you can safely assume will be different, so something like Antti's solution makes sense to me, even with not keeping empty folders around.
  18. Awesome site and lots of talent! I do love the logo as well - very clever but so simple too.
  19. Hmm... I'm not sure there is a way around that to be honest. I originally thought of URL segments, but they only apply to things after the end of a URL. I think the only way to do that would be some sort of custom module to override the way PW handles URLs, but that would be far more trouble than it's worth I suspect given the number of much easier alternatives available.
  20. I might be taking things a bit far with my latest idea, but I have plenty of scenarios where I on;y want a specific crop to be available to the first image in a list of images and not the rest, and then have a different crop available for the rest and not the first one (so first thumbnail bigger than the rest). I was thinking of trying to re-jig the code I did to allow crops to be tied to specific templates to something like this: big_thumbnail,300,200,news:first,article small_thumbnail,160,100,news:!first,article So in the code above, for the news template a colon separates the template name from a keyword - first - so the big thumbnail is only available as an option for the first image in the list. In the second config row for the small thumbnail, it is !first, with the exclamation mark meaning NOT (as it does in PHP). Both crops are available for all images in the article template as no image-specific setting is specified for that template. I did quickly look into this a few weeks ago and it looked a bit more complicated than the previous code change I did, but I don't think it's impossible. The only concern I can see here is that as soon as you re-order the images, the first image in a list might be further down the list, so I'm not sure what to do there. Maybe I should just assume that people would click Save once they've re-ordered the page and then they can re-select their crops as normal? I think that that would be a small price to pay for the additional functionality - especially since not a lot of people may find it useful, but I hope others might see the benefits and have some usage scenarios in mind too Anyway, it's not high up my list of priorities, but I thought I'd see who else is interested in this.
  21. The simplest method has been mentioned - having an extra field for the template to choose whether or not it appears in the header or footer menu. Personally, my take on that would be to assume that all pages will appear in the header menu and have the extra field simply be a checkbox labelled "show in footer menu". That way you can easily output a header menu excluding pages with that checkbox selected, and output a footer menu for those pages with the checkbox selected. This is of course just variations on what others have said further up the page, but with field widths being adjustable now, you could even do something like make the page title field be 80% wide, have the checkbox 20% wide and then when editing pages the checkbox will appear neatly at the top-right of the edit screen and not take up a lot of space at all (which I'm guessing is the original poster's main issue with it?)
  22. You might already know this, but if someone doesn't have edit permissions for that page then they won't see the Edit button (though you will for every page as you're a superuser). If you want to remove it completely though, edit site/templates/foot.inc and remove this: <?php // If the page is editable, then output a link that takes us straight to the page edit screen: if($page->editable()) { echo "<a class='nav' id='editpage' href='{$config->urls->admin}page/edit/?id={$page->id}'>Edit</a>"; } ?>
  23. Oops - you're right, it does work in FF but I had forgotten to clear my cache! Thanks! Looking great once again
  24. Hi Soma It doesn't work with the new variable width fields - they still sit on separate rows Take your time though - I'm only letting you know as I love this theme and use it on all PW projects
  25. Oh. Oops.
×
×
  • Create New...