Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/23/2012 in all areas

  1. One of the PW sites I've been working on recently: http://www.ukiahpolice.com This project was structured really differently from the start, in comparison to most sites I do. In our planning, we decided that the first task was just to put up the front page of the site, and then evolve it over time. It's still evolving, but should be completely wrapped up soon. Changes are coming for the small screen views and several sections of the site. The chief has been really happy with it. He presented the site to the city council this week so I'm calling it presentable myself. My favorite part of this has been working with another developer on additional software that uses the PW API to populate the database via email attachments and funky things like that. We're looking at hooking up a fax API too. So a big part of this for me has been the pleasure of creating not just a website, but an extension to the department's workflow that makes it easier to disseminate information. We've had some interesting moments in working with law enforcement software providers, too. We planned on basing some of our social media involvement around a web service that would broadcast crime information to Twitter and Facebook. When the time came to hook it all up, I discovered that the features weren't working. I kept reconnecting and re-authenticating on Twitter and Facebook, but got nothing. Eventually I contacted the service provider and they said that these features were "in alpha" and "the buttons don't do anything." Cracked me right up. The features are even documented in their quick start guides!
    2 points
  2. Usually simple honeypot is enough (put a inputfield quite a top of your form, hide it with css and if that inputfield has any content, then show error and don't allow the form). PW comments module has something similar, search for requireSecurityField on this page: http://processwire.c...types/comments/
    2 points
  3. Not tested, but cant't you store your custom sortfield temporary in your pages and sort them later by this field? Something like this: foreach ($yourpagearray as $p) { $p->sortfield = toLowerCase($p->title); } $yourpagearray->sort("sortfield"); EDIT: this code should work: foreach ($yourpagearray as $p) { $p->tempsort = strtolower($p->title); } $yourpagearray->sort("tempsort");
    2 points
  4. This module adds page to Admin -> Setup -> Redirects where you can add 301 redirects (inside your site or to other domains). Screencast: http://www.screencast.com/users/apeisa/folders/Jing/media/e29abcca-5ef0-44dd-ac9a-2cc70f53d2c6 (I have Chrome with Instant on so it previews pages before hitting enter.. but I'm too laze to record another screencast. Also there is sneak preview to my upcoming admin theme...) Download & Installation: https://github.com/apeisa/ProcessRedirects/archives/master, unzip all the files to /site/modules/ProcessRedirects/ folder, check new modules from bottom of the modules page and hit install on ProcessRedirects. More information and "tutorial" how this was done can be found from here: http://processwire.com/talk/index.php/topic,167.msg1071.html (and like you can see, most of the code came from Ryan's hands, I just wrapped it all together). Hope you guys find this useful. Not tested yet on many servers, so all the feedback is more than welcome. ProcessRedirects5.zip
    1 point
  5. The reason those options don't appear if the cache time is set to 0 is because 'cache time' is not just a time, but also a toggle. When non-zero, cache is enabled. When zero, cache is not enabled. When cache is not enabled, none of the cache options are even considered by ProcessWire. But if you want to bypass ProcessWire's cache settings at runtime, you can do so. For example, you could use the 'URL pre-segment' approach, enable the cache, and disable it manually before rendering the page: $mypage = $pages->get($path); $mypage->template->cache_time = 0; // disable the cache echo $mypage->render();
    1 point
  6. Hmm, not the most descriptive topic title i've ever seen I would probably start from top to bottom, from the calibration certificate to test chart: lifting gear, and carefully write down all the fields needed. From having a quick look there are a lot of fields that are basically the same but only differ in the label. Try to minimize (DRY) the number of fields and make things as reusable as possible. For this the 'field template context' feature can be quite nice (http://processwire.c...mplate-context/). Also, be sure to make good use of the page fieldtype, to make things maintainable and consistent as possible. Look at your data-structure from a relational (orm) pov, of course keeping in mind the PW style of doing things in this regard. Once you've got all your fields in the system i would basically create a template for every element you got in the dropdown on your example page. Add the fields to the templates the order and way you like and start to test things. I also see fields like 'customer' and 'calibration performed by'. Will all this data be available in PW or do have to interact with other systems, like a crm or stuff like that? Also, will the people who perform tests login to PW to add pages? Or do you plan to build some sort of front-end for them to do their stuff?
    1 point
  7. Yes and no, interrobang You're right, and I just solved it using your solution... But you seem to have stumbled into a protected field, maybe? Using "sortfield" as a temporary field throws an error, renaming it to something like "mysortfield" makes it work like a charm! EDIT: so sortfield it's the sort setting for a page's children.
    1 point
  8. I'm working with a events calendar myself, though I elected to take a more service oriented approach using google calendar and outlook generated *.ics feeds. If your calendar is going to be as simple as you describe, you might be able to get away with the following approach. Set up three datetime fields - event_start, event_end, and recurrence_end. Set up a text field, recurrence_rule (rrule). Add the PHP When library to your project. For recurring events, set your rrule based on byweekday, bymonthday, etc. You can generate rrules with a google calendar (add a recurring event and look at the ical feed) if you're new to them. For the range to be displayed (e.g. today + 3 months) you can use the api to get all events that have start/end OR start/end-recurrence overlap with the displayed range. Set up an array and loop the events, using PHP When to generate a list of occurences if an rrule exists, push rule occurences and non-rrule events in as as siblings, sort by event_start/occurence_start. Render the list of occurences. That's the basic formula anyways.. If you are avoiding google only because of the look of thier embeded calendars, you might consider rendering your own calendar of events with PHP When and the raw icalendar (*.ics) feed they provide. Edit: grammar.
    1 point
×
×
  • Create New...