Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/19/2012 in all areas

  1. I read that and did a "DOH!", to quote Homer Simpson. Sorry Ryan, I didn't spot that silliness on my part
    1 point
  2. Actually it needs to be whatever you've named your comments field, whether 'comments', 'comment' or feedback', etc.
    1 point
  3. You can find a list of built-in page fields here: http://processwire.com/api/variables/page/. As you can see, "date" is not among them. What you seem to want here is "created." If you need the value of that field to be easily editable later, you could also create your own date field and apply some magic to that -- check "Default to today's date", hide field and show when needed / show always and handle pages with date value cleared somehow etc. Hope this helps!
    1 point
  4. With siblings, since it also returns always the page itself (where it is called), $page->siblings will always return at least one page object. SO you would have to check if the count is greater than 1. Not? In this case, you would do something like this to check if the current page has any siblings. if( count ( $page->siblings ) ) > 1 ) { ... } An alternative would be to use the count method for Page Array in PW. if( $page->siblings->count() > 1 ) { ... } As for checking if a field is empty. The if condition works with different return values type false|0|null|empty as false. So if something returns 1 or more it will be true. Usually a if($page->field) will work with textfield and also checkbox (0=not selected or 1 selected) and more. To check if a field exists is a little different. It won't trow an error if the field doesn't exists in a if condition in PW. Also this is not something you'll be doing most of the time but you still can. php isset will return 1 if the property exists (even if empty) in the page object. if( isset( $page->field ) ){ ... }
    1 point
  5. Me: Ryan: → Fantastically fast and helpful post ← I'll take that as an emphatic "YES!" then Ryan THANKS again for the help; it's so appreciated. Having a smile-inducing time rattling out my own blog system based only on PW API and dollops of cleverness courtesy kind people like you and others. It's a delight working in PW even tho' my speed may be lower than some due to my PHP learning curve. Thanks again for such a generous and excellent project.
    1 point
  6. That'll be fine - I'm off tomorrow through til Monday to finish decorating the house but I definitely don't want to be doing that all day every day so I'll have time to set this up. As long as we don't plan on using it forever I'm fine with it - it can become a bit of a resource hog over time and we would need to keep an eye out for spammers but this server should definitely be able to handle it. My knowledge is reasonably good in terms of setting it up but a bit flakey in terms of day to day operation so if nothing else it'll be a learning experience
    1 point
×
×
  • Create New...