Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Hani

  1. Thanks for the super-quick and thorough reply! I haven't had a chance to integrate your suggestions on fixing the error I'm getting, but I did want to answer your question before doing so - and see if what I'm doing really is the path to take. You asked: I definitely did consider that structure the data - and it would work very easily given the architecture you built for pages. But I guess from a pure "usability" standpoint, I'd like to take it out of that hierarchy for a couple reasons. 1. Lots of videos I have hundreds of event videography videos/DVDs to list. If I recall correctly, you have a pagination feature in the Pages hierarchy...so the page itself won't be miles long when viewing the children of the Video Library page. But navigating to that "one" video to edit it wouldn't be as easy as it could be. By giving the Video Library management page a view that is more like "Users" and "Roles", it provides more of a "table-like" data view. Which is essentially what it is going to be. And just like "Roles" and "Users", there will be no need to define a specific order for the videos like you do in the hierarchy of the site's pages. (They'll be ordered by volume number.) I guess the thing to take out of that whole blurb is that the video library is essentially a table-like data set with a lot less requirements than pages. Each video record doesn't need to be a "standalone page"; they'll simply be listed on the website on a "Video Library" page (not to be confused with the Video Library page in the admin console). 2. Filters The "Filter by roles" feature on the "Users" page is awesome - and I'm hoping to implement a filter by event date for the Video Library management console. Additionally, I'm hoping to integrate a textfield in the same area where I can type in a volume number and it will filter it down to the video(s) that match. As PW is built right now, you can't do that in Pages. I guess for those two reasons, it feels like it might make the admin console more organized by separating Pages and the Video Library into different "data sets". I came across a post in the forums in which someone mentioned having a "Staff" page on his website and I think he may have done it by simply adding each staff member as a page within the site's hierarchy. That totally works and fits right in with the architecture of PW. But I can see the method I am imagining also working for him as well - especially if the staff datatype is very specific, such as, "first name, last name, position, email, phone, photo...". The video datatype I have is also very specific: name, description, volume, event date, price. Granted, ALL datatypes are specific. But this differs from the pages datatype simply by how they will be displayed on the website. Given all that, would you approach this differently? Or is what I'm doing seem logical? (Just a final note that I definitely appreciate the time and effort you've put into PW! You've built an awesome product. And I really do appreciate your time and guidance on the subject at hand as well!)
  2. I'm new to ProcessWire - and so far I'm lovin' it. Nice job, Ryan! I've read through the API docs and think I have a fair understanding of the functionality. However, I wasn't able to figure out if what I want to do is something easily done through the API, through a module, or if it has to be done outside of that architecture. As an overview, the goal is to have a list of items that can be created, updated, deleted in the backend in the same manner as creating, updating, deleting users, roles, etc. Basically, I created a new section in the Admin console called "Video Library". I was able to do this by creating a new page with that name and putting it under the "Admin" page. No problem there. At this point, I looked at the ProcessUser and ProcessRole modules to see if I can use those modules as templates to build what I need. I created a ProcessVideo module that extends Process. I got to a point where I can see a list of videos that are in a table in the database. (I manually created a table called "videos" in the db and added a couple entries.) I can see it in the same format as one sees the list of users. But when I go to edit one of the videos, I get an error that says: Fatal error: Call to a member function get() on a non-object in T:\htdocs\shamrockvideo\site\modules\VideoLibrary\ProcessVideo.module on line 195 That error references the following line: if(is_null($video)) $video = isset($_GET['id']) ? $this->videos->get((int) $_GET['id']) : new Video(); I guess a definitive question to ask is: would $this->videos within my code mean I am off track? I think I'm missing something crucial in my understanding of this all and would appreciate any guidance! I'd really like to see this all work with ProcessWire because I think I'm falling in love with it. I'm attaching the module. Please forgive me if the code is a mess and I'm not on the right track. VideoLibrary.zip
  • Create New...