Jump to content

ferdinand

Members
  • Content Count

    10
  • Joined

  • Last visited

Community Reputation

2 Neutral

About ferdinand

  • Rank
    Jr. Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks Robin. And yes, that would be one option. One that seems lot easier to do. But since they have a lot of courses on display and frequent updates, that would mean a lot of creating and destroying pw-coursedocuments. Or synchronizing both storages (which we did in Drupal6). But neither approach ist really nice of I can easily assemble all the data by doing a few small queries on the source database. Thats why I'd much rather find a way of buidling dynamic loading into pw. Am I missing something? Is that a silly idea? Thanks for your opinions.
  2. Thanks for that hint. I checked out that class but I can't connect it to the problem. It seems to me that the Page-class itself would be far more suitable. Is it possible to create a subclass coursePage and overwrite some of its methods (like getParent, children() etc. with my own code that works within the logic of the courses-database? And if so, how can I make pw use such a modified object.
  3. Thanks for that info. Good to know where that data is stored. Is there any way to intercept pw when it retrieves that information so that I can substute it for virtual pages?
  4. As a follow up to the question above. How does pw determine 1. relationsships between pages (i.e. which children does a page have) 2. which template to use. And is there a way to intercept this process? Obviously both questions are normally answered by data that is created when creating a page (selecting a template and a location for a new page), but would not exist in virtual pages. And exteme way of solving this would be to use the same standard template for all pages but I#d rather use a solution that extends the system rather then replacing it. Thanks for any ideas, Ferdinand
  5. Ok, I understand how that works and will try to implement this for the pages. Thanks you so much for your help.
  6. Yes I think I'm beginning to undertstand. Correct to say that I add a general property courseData to all the page objects and whenever that is read I call my function to provide the data? And using the $event->object->name property I can retrieve the name of the calling page and return data specific to the url? That would work. And yet it makes you wonder, why there is not page_load_data field_load_data hook in pw. Any ideas why that is so?
  7. I think I'm missing something. The example shows how to access a database. PW or other run a query and retrieve data from it. And that part I understand. And of course I could also write all that into the template an thus fill my page with data. But in doing so I would also mix business process code (generating the data) with presentation layer code (using templates to make the data look nice) and I would like to avoid that. And I was thinking that a system full of hooks would als have a load-field oder load-page-data hook that I could intercept in my module and hand over my custom data to pw for presentation. Am I thinking in the wrong direction here. Or is this more that pw aims to provide?
  8. Thanks Adrian, this is what I was looking for. Or sounds like it. Will do some reading and check it out.
  9. Wow! So many responses so soon. This is an active community. Thanks first of all. Now some of you asked me to elaborate on the purpose. So let me try to be more specific. The data we use is drawn from the clients internal course managment database which we access as mysql-tables. Every day we display a limited selection of all courses (usually a window from today-10 days to today+1 year) on the website. Access to the courses on display is provided by one- or two level access path-Strings that can be defined for each course (i.e. languages->german) More than one access path may be defined to allow different ways of finding a path. (i.e. job->conflict AND communication->work-related). Each access path becomes a menu and submenu in the userinterface. In a previous implementation of this in Drupal 6 we did in fact import all course data into the Drupal data model and ran an update of this database whenever a new import was done. But with a system as flexible as pw I'd like to implement the real thing and hook database access. In short: Whenever PW receives a request for course "Dancing with the devil" a hooked call does all the queries of the external database (teh url tells me which data to retrieve) and returns all the desired field data to the calling procedure. So that as a result my $page-Object in the template is filled just like it would be if I rendered a normal page. Ideally the same would apply when generating then menues (I'd just return an array of menu items to render) or the page that lists all the courses that have a certain access path (languages->german).
  10. We are planning to display course data from a non-pw-database in processwire and I'm looking for a way to hook the pws page data loading. But I haven't found a hook for that in the cheat sheet. Ideally we would like to provide all field data in more a less raw form to a hook whenever page xyz or a pw menu is build and have pw templates the render the data like it does for a normal page. Sorry if this is a silly approach. We have just started Thanks, Ferdinand
×
×
  • Create New...