Jump to content

ryan

Administrators
  • Posts

    17,253
  • Joined

  • Days Won

    1,708

Everything posted by ryan

  1. Thanks for your feedback. This is an interesting topic, and I'm not sure that I totally understand what you are saying, and may need more context. But looking at the diagram you linked to, it reminds me of why ProcessWire was built in the first place. I'm equating their 'sections' with templates in ProcessWire. But their definition of templates are also something separate beyond that, and 'entries' are a separate entity from 'pages' (if I'm understanding it correctly). While the terminology is varied, this is what I was describing as one of my fundamental problems with EE and Drupal. I'm not suggesting it should be a problem for you or anyone else, but for the sites I develop and the way I develop them, I don't like extra layers of complexity that fall outside the context of the front-end. Not specific to Symphony, but consider: channels, nodes, taxonomies, categories, sections, entries, resources, and on and on. Taken in the context of the front-end and boiled down to their core, they are all pages or behave like pages. Looking at the big picture, IMO these are all unnecessary complexity and that's why ProcessWire is designed exclusively around pages. Earlier versions of PW and Dictator have been split out into more layers (not unlike that diagram, and even using some of the terms mentioned above). Over time I've found more benefit to reduction and simplification. Far more benefit than to the occasional and potential flexibility of keeping them separate. if you get deep into the API, you'll even see one hold-out: Fieldgroups (aka sections in Symphony) are separate from Templates in the API, but not from the admin. And that will probably change eventually too as we work to simplify more and more. The goal with PW is not to solve all needs, but to solve most in the simplest way possible. I like to wander into concept and theory, so please forgive me for straying off topic a bit. It sounds like you are talking specifically about building forms... though I still haven't figured out how to connect that with the diagram. But we don't have a form builder (other than the one used by the admin). The form builder is scheduled for version 2.3 of ProcessWire. So this type of feature is on the roadmap, but multi-language functions are coming first. The form builder is not next on the priority list only because it's not something that necessarily provides more flexibility, just saves time (i.e. you can implement forms of equal flexibility and power without a form builder). The challenge will be to do all this while continuing to make the system simpler, and we'll get there.
  2. It should be fine to remove all of those. I would suggest disallowing indexes just for security (keeps prying out of directories without index files). But if indexes are already denied, then all good. The ErrorDocument stuff is just an optimization to keep the favicon.ico and robots.txt requests from getting sent to PW. It is fine to remove those. The FilesMatch is a secondary measure and it should be okay to remove. Several of the RewriteRules are doing roughly the same thing. The php_flags are just optimization and are fine to remove. Likewise DirectoryIndex is fine to remove.
  3. Adam, can you try clearing your cache: Admin > Modules > Page Render > Clear Cache To me it looks like a permissions issue. So if you get errors when clearing the cache, or if it doesn't work, you might want to try and remove all the dirs below cache/Page/ manually. i.e. rm -rf /site/assets/cache/Page/* I think Almonk also wrote some shell scripts that do this. Let me know if the error persists after clearing the cache.
  4. Okay good news, this is now available in the latest commit of 2.1: https://github.com/ryancramerdesign/P21/commit/da6418cedeede89b7039341536641e5080fea144 To use it, you have to add a ".count" to the end of your field name. Using your example from above: $children = $page->children('images.count>2'); The reason you have to use ".count" is because without it the operator is comparing the image's filename. While I could redirect the ">", "<" and related comparison operators to the count, I wanted to find a consistent way to do this throughout the system, and adding ".count" to the field name seemed the most logical way to do it. You can use this with any multi-value field: files, images, page references, comments, etc. You can also use it with a page's children, i.e. $children = $page->children('images.count>2, children.count>0'); Note that all pages have a 'children' property, so it can feasibly match any page. But maybe not all pages in your system use a template with the "images" field. PW doesn't attempt to match pages that don't even have the field, so if you did this: $children = $page->children('images.count=0'); ...that will only match pages that have an images field with zero images. It won't match pages that don't have an images field. This is for consistency with other selectors. Please let me know how this works for you and/or if you run into any errors with it. Thanks, Ryan
  5. Hi Stephen, Welcome to the forums and good question. Here's one way you could approach it, assuming all those posts were under the same page (like /blog/). I'm somewhat limited on time right now, so this is written in the browser and not tested, but I can follow up with more detail later if you'd like. <?php $blog = $pages->get("/blog/"); $startYear = date("Y"); // this year $endYear = 2009; // or whenever you want it to end $now = time(); for($year = $startYear; $year >= $endYear; $year--) { for($month = 12; $month > 0; $month--) { $startTime = strtotime("$year-$month-01"); // 2011-12-01 example if($startTime > $now) continue; // don't bother with future dates if($month == 12) $endTime = strtotime(($year+1) . "-01-01"); else $endTime = strtotime("$year-" . ($month+1) . "-01"); $entries = $blog->children("created>=$starttime, created<$endTime"); // or substitute your own date field $date = date("m-Y"); echo "<li><a href='./$date'>$date - " . count($entries) . "</a></li>"; // output the month and count } } Then you'd use the same template to list the entries when a $input->urlSegment1 has a date specified in it. Basically you'd cycle through the $entries found above and link to them. This is rough and just approximate. I'll be glad to follow up with more detail... but wife is telling me to get off the computer.
  6. I've got an update for you in 2.1 which makes this available. I'm going to run it through a little more testing tomorrow, and if all checks out I'll commit this to the 2.1 source.
  7. Well PW 2.1 is very close to becoming the current stable version. I have a few details to take care of, but think it's just about there (perhaps by the end of the month). I'll keep the 2.0 branch going for bug fixes but probably won't be adding new features to it... this is already the case.
  8. Thanks for the feedback, glad that you are finding a lot of sites to be a good fit to develop in PW. I've not yet had the opportunity to try out Symphony, but had heard good things about it (and like what they've done with their site). Still glad to hear that PW makes it easier to manage page content. I remember several years ago there was a fairly impressive new blog platform that came out called Symphony (not sure where that went)... and then there is the Symfony framework (different spelling). A little confusing, but it is a good name. Even though I've not used Symphony, I have used quite a lot of other CMSs. EE was one of the more frustrating to me because there was so much to like about it (people, CodeIgniter, design, company), that you are willing to go further, invest time into it and look past some of it's strange ways. So the "deal killer" moments came later and were a little more frustrating. I think those "deal killer" moments are different for every person, so it's not to say anything bad about EE other than relative to what I was looking for (and I'll still use it when the project requires it). But now you have to invest money in it before you can even try it. I suspect this is why they don't have a free demo version of EE2 anymore (they did for awhile). With the current CMS landscape, one probably isn't going to be willing to invest the time to figure their way around the odd complexity of EE unless they've already bought it (IMO). And once you've invested that time to really learn it, at least it doesn't let you down–it gets the job done. But it hurts that portion of the audience that seems convinced they are locked-in and incapable of learning anything else.
  9. Well it's actually easy to identify the resized versions because they always follow a common format of filename.123x456.jpg (or substitute another width/height and image extension). Whereas the originals have the same filename, but without the .123x456.jpg part. So the cache clear will be pretty straightforward to write... it'll just look for any images that have that last part and a corresponding filename without it. Then it'll remove all the versions with the .123x456.jpg in the filename. But tracking them down requires a regular expression, so it's not something you can do so easily from your OS (unless you are good with unix file commands... I wouldn't know where to start). So assuming that the full size versions you already have in there are good, then you should be able to resize them to a different dimension. That leaves you with just the extra/unnecessary files you want to delete. Do I have it right?
  10. Adam, ProcessWire doesn't actually resize your original image, so they should still be in tact. All you have to do is change the resize dimensions and it should be creating the new sizes from the original. But if you want to go in and delete all the extra files for sizes you aren't using anymore, give me a couple days. I'm working on an addition to the FieldtypeImage module for that (an image cache clearing module).
  11. I don't think as much about the mathematical stuff (as much as the SQL stuff), so I'm glad you guys are looking at it in this perspective too. Ultimately we're translating to SQL logic and the 'making sense' part is preferable to mathematical rules since selectors are a form of data queries rather than mathematical statements. But ProcessWire selectors are something new and aren't based on any existing standard, so we're kind of defining the standard here, and that's what I really like about these discussions. The more thinking that goes into the details like this the stronger it will be.
  12. I was just reading this post on how to make breadcrumbs in ExpressionEngine (http://bit.ly/hello_crumbly) and how you basically have to resort to a plugin to do it for you. It reminded me of some of the problems I had with EE when I was trying to use it and develop in it awhile back. One being that URLs aren't a primary/unique key to a page, natively in the system. Imagine ProcessWire with only it's root level pages and url segments, and that gives you an approximation of what you have to deal with in EE. I'm not saying it's wrong, but it's a different approach, and one that I found frustrating to work with. The post also made me realize I didn't have anything on the site demonstrating how you might make a breadcrumb trail (other than in the default site profile). It's really a simple thing (at least, relative to EE), so figured I'd post here. : <?php foreach($page->parents() as $parent) { echo "<a href='{$parent->url}'>{$parent->title}</a> "; } You may want to output those as list items or add some >> signs between items, but as far as code goes, the above is all there is to it. What it's doing is just cycling through the current page's parents till it reaches the homepage. Lets say that you also wanted to include the current page in your breadcrumb trail (which is probably redundant, but some sites do it). What you'd do is just append it to the list of parents that gets cycled through: <?php foreach($page->parents()->append($page) as $parent) { echo "<a href='{$parent->url}'>{$parent->title}</a> "; } The reason this is so simple is because every page is anchored to a specific URL and those URLs are representative of the site's actual structure. Pages in PW are actually uniform resource locators (URLs) whether on the front end or the back end. Because of that, there's no guesswork or interpretation to be done. In EE and Drupal (as examples) that data does not natively live at a specific URL. Instead that data is off in a separate container and the ultimate URL (or URLs plural) where it lives–and will be presented by default–are not as cut and dry. Yes, you can install plugins or go through strange taxonomic/channelistic/cryptic trials to approximate the behavior in other systems. And yes you can use url segments and pull/render any other pages you want in ProcessWire according to your own needs. But I'm talking about the fundamental and core system differences. This difference goes far beyond simplicity of generating breadcrumbs–it is a factor that translates to simplicity throughout the API.
  13. Thanks -- This logic has been updated in the latest commit.
  14. PW is treating that literally exactly what it says: id != 5780 OR id != 5800 If you read that logic, you'll see that it can't ever exclude pages from that. But it's a bit of a mind game, because I think people actually see this, even though it's not what it says: id != 5780 AND id != 5800 Anyway, the proper way to state such a condition in a selector is: id!=5780, id!=5800 But what is the point of a OR "|" in a negative condition? Considering your example, it seems the "|" in a negative condition is useless. I'm thinking we should have the PageFinder engine consider the "|" (OR) an AND when in a multiple value negative selector ... because this seems like a more natural/expected behavior. I had assumed it must be a bug when first trying it, because I was looking for the same behavior you were until I realized PW was actually doing what it was supposed to... though this behavior seems futile. I'm going to change it unless anyone else wants to weigh in on this or catches some logic I might be missing?
  15. Are there any hidden files in there? try this: ls -alR /site/assets/
  16. Adam not sure why that would happen. Can you rename the /site/ dir? Are there any files in there (/cache/Page/ or /sessions/) that don't have the right permissions?
  17. Not unnoticed, just things to do before this. But I'm quite certain we'll be doing this once getting through the current todo list. It looks like we now have two different and good ways to do this (whether 2 columns or half width fields) good suggestions!
  18. ryan

    Memory Bug ?

    I'm guessing that installing all the 3rd party modules might be a problem because many were designed for version 2.0 not 2.1. Unless a module specifically says it'll run with 2.1, it's probably not been tested with it. Do you have a guess about what module it might be? -- for instance, did the problem start appearing after you installed one of the modules?
  19. Adam, haven't gotten your email. What address did/are/you sending to?
  20. ryan

    Memory Bug ?

    Can you describe the series of steps I would need to take on my server in order to duplicate it? Also, what version (2.0 or 2.1)? Thanks, Ryan
  21. It's definitely planned -- I have a need for it myself. But it's not on the short term list. Most likely I think we'll target this as one of several items in 2.3.
  22. So it's not safe for me to assume that you want $this->process or $this->page->process. It really depends on the context. In the example you linked to, it has to check $this->page->process because it's checking to see what process is going to be executed, not what process is being executed. Since it was a 'before' hook happening before the page render, the value of $this->process was always going to be ProcessPageView (viewing an admin page). But once that page render started, then it would load the new process (ProcessPageEdit or otherwise) and execute it, and then populate $this->process with that one instead. So the value of $this->process will change according to what is being executed and where it is in the execution process. That's why it's checking against $this->page->process rather than $this->process. Let me know if this doesn't make sense, I'm trying to type this out quickly and am not sure if I'm being clear.
  23. What I meant by 2 queries where you would first find the parcells based on the non reserved value. Then go through those parcells as the 2nd query and look at which ones don't have any houses attached. i.e. $parcells = $pages->find("parent=/parcells/, reserved=0"); foreach($parcells as $parcel) { if(!count($parcel->houses)) { // found one } } I'm at the AEA conference here in atlanta, so a little slow on my replies today.
  24. If the page in question actually has a field called 'process', then checking $page->process is going to return the value of that field. But $this->process [or wire('process')] is a runtime property that is made available to the system and represents the process that is currently running. My guess is that you probably don't want to be looking at the $page->process.
  25. It'll be stated once the modules documentation is complete. Though I'm not yet sure it'll stay that way. I might change the loader to just look at what classes they implement rather than the naming convention... not yet sure. What do you guys think?
×
×
  • Create New...