heldercervantes

Members
  • Content count

    160
  • Joined

  • Last visited

  • Days Won

    2

heldercervantes last won the day on July 16

heldercervantes had the most liked content!

Community Reputation

179 Excellent

About heldercervantes

  • Rank
    Sr. Member

Contact Methods

  • Website URL
    http://heldercervantes.com

Profile Information

  • Gender
    Male
  • Location
    Porto, Portugal

Recent Profile Visitors

1,871 profile views
  1. Hey @netcarver, I saw your module on my research. Cool stuff. But my case is different and too specific. It's for an online store, and it looks for specific stuff like changing the orders' state or adding a note. It then looks for the client's email address and sends out a notification. I'm also implementing a way of having email templates for various things, like welcoming a new user, notifying of password changes, stuff like that, which are editable in the admin, and are triggered by the frontend when need be. And having fun doing it.
  2. Damn were you right. I'm hooked. Refactoring a bunch of stuff with a grin from ear to ear.
  3. Of course. Should be using $this->session, instead of just $session >:[
  4. I've managed to get the uncached version of the page and do comparisons successfully. Now my problem is something else. One of the fields I'm comparing is a repeater, and I'm noticing that in this case the saveReady hook is fired twice (or more), one time for the new entry in the repeater, and another for the page. So far so good. But now I need to compile changes and react to them all in one go at the end. So here's what I did: Hook before saveReady, I start by looking at $session->controlArray and set it as a new array if unset; Push to that array as I compare the various thingies; Hook after save parses controlArray, reacts to what's changed, then resets the array. But my controlArray seems to be scrapped after each hook.
  5. Hi guys, I almost feel like a grown up, now that I'm messing with creating modules. I'm trying to do something that, when a page is saved in the admin, detects certain changes and reacts accordingly. Example: Say an orderState field for... an order's state. And when the admin changes that state to something else, I want to fire an alert email to the client. So I started from this example and I'm working my way up from there. It's working fine, but now I need to know how to add a hook that gives me the page as it was before saving. I tried `...addHookBefore("save"...` and `...addHookBefore("saveReady"...`, but both give me the page after the changes. I'm sure it's super simple and I'm going to say "of course" once someone points me to the obvious solution that's right in front of me, but for now all I can do is bang my head against the wall and thank you in advance for your much appreciated help.
  6. Pretty sure you can add a hook somewhere, catch the errors you want and send out an email. This would make great module though. Perhaps with the option to get a weekly digest of the log action. That'd be nice.
  7. Not really giving you a solution, but rather sharing my sympathy. I've had the same problem applying the pages field to the user template with a condition. In my case, I was showing the field if the user had a certain role. As you describe, it shows/hides as expected, but doesn't save. Bummer. Eventually left it open, and added a description telling the admin to "Use this field for yadda yadda on X role users".
  8. Not sure I'm getting exactly what you want to do. You can specify a different file for a template. Edit your template and in the Files tab, look for "Alternate Template Filename". I've never tried pointing to a subdirectory there, but don't see a reason for it not to work. You can, as monchu stated, simply not create the file. I use file-less templates all the time, whenever the frontend doesn't require an actual page to exist.
  9. This is a tricky one, and the solution on the CMS side depends on how you want to do the frontend. You will not find a module that gets interactive 3d working on your frontend. PW modules mostly offer you ways of storing and retrieving info, but don't actually generate frontend widgets like slideshows and that kind of thing. First of all, the repeater is a go to module that you'll probably need somewhere along the road. Then just remember you can use file fields for storing 3d models or even JS that you load dynamically on the frontend, image fields for textures, and you have other field types for just about anything you can think of. For example, look at the nib selector on step 3 of your example. You can use a repeater to store each nib. Inside each repeater item you put in a title, an image file for the thumbnail, and a file field for the 3d model in whatever format you're going to use. Then you just have to figure out how to output that in your frontend so that the nib options can be managed from the CMS. Start by getting your frontend working statically. From there you'll see how to divide it into smaller chunks that can be served by PW and take it from there.
  10. Hi guys / gals. Rimaa deals with logistics and moving products around. They needed an interface for their clients to check the status on their orders and that's where I came in. Not much you can see just by visiting the site, because this is actually a private mobile oriented web-app. But see some screenshots below. This project features some cool things under the hood: First, the content is managed from a Google Spreadsheet. PW connects to the spreadsheet on an interval (that can be configured), parses the sheet and updates the orders list. So the various people that share that spreadsheet and keep it updated for internal control, are also maintaining this platform without even knowing it. PW users templates was modified to allow for this platform's different roles: Client : only sees his orders Agent : has a set of clients he can overview Super-agent : sees all clients Updated orders visual cue: Comparing the current version of an order (by $page->modified) with last viewed version's date (stored in an repeater on each client), the app turns on a visual cue that the order has been updated since it was last seen. Viewing an order is an accordion-style CSS toggle, so at that point an Ajax call tells PW to update the last version viewed by the current user. All in all, a very little project that once more shows the flexibility we get from this awesome API. Being able to modify users to have the fields we need to get something like this working is a beautiful thing.
  11. Wow! That's a great idea. Thanks
  12. Fortunately I live quite far from where the fires hit. Unfortunately those are a regular occurrence here, though this year was the worse I can remember. Mediterranean weather + atlantic moisture = lots of trees. Add a freak heatwave and boom. But it's been calm since that one, and hopefully it was that last straw that makes people take real action to prevent more tragedies like this.
  13. I've seen a few threads on this, but not a really definitive answer that's as clean and simple as most things are in PW. I have a products catalogue that branches out with an unlimited number of subcategories. As the user navigates the categories menu, it's supposed to show a list of all products from that point down, with pagination. So I'm doing this: $pl = $page->find('template=product, sort=sort, limit=60'); And from there I foreach to make the product grid and renderPager() for pagination. But the order on the products is not that of the admin. I need them sorted like they are on the admin, grouped by parent, as if you had the whole tree open and picked products from the top down. As of now, my only solution would be to code an iterator that would crawl all subcategories, adding products to a pageArray. Seems overkill. Any better ideas? Thanks
  14. Thanks!
  15. Small world. I met my wife in Porto as well I hope to visit NZ too one of these days. Processwire is a special thing. I'm sure we'll continue seeing it grow steadily in the future.