WEB Drupal Question

Discussion in 'OT Technology' started by k2737, Mar 16, 2009.

  1. k2737

    k2737 Active Member

    Joined:
    Nov 29, 2004
    Messages:
    3,324
    Likes Received:
    0
    Location:
    Ft Lauderdale
    I am redoing our internal web site with Drupal and I am attempting to re-create our internal Phone Book/Directory. I have created a custom form with the all the fields I need....is there a way I can do a custom view and print it out to a page to just list the information taken in by the form? Or do I need to make a custom PHP job to query the database and display it? :o
     
  2. Mikenotmike

    Mikenotmike

    Joined:
    Jun 1, 2001
    Messages:
    6,244
    Likes Received:
    0
    Location:
    USA
    have you tried using views yet? You can create custom queries with the UI and output it to a block or page
     
  3. k2737

    k2737 Active Member

    Joined:
    Nov 29, 2004
    Messages:
    3,324
    Likes Received:
    0
    Location:
    Ft Lauderdale
    I am playing with views now but I am a noob to it. Do you know of any good how to's for views?
     
  4. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    How did you create the form? Did you do it by creating your own module using the Forms API? If so, you can easily just do another menu hook to establish the page you want to show the variables. From there, you can create a function that will pass the variables into a template preprocessor function. This function will allow you to setup variables in a template file to display on the page you specified in your menu hook.

    I hope all that made sense.

    Take a look here: http://drupal.org/node/223430

    If you used CCK to create the custom fields, you can modify your node-*.tpl.php file for a specific template and straight out call the CCK variables in there.

    Take a look here: http://drupal.org/node/93622
     
  5. k2737

    k2737 Active Member

    Joined:
    Nov 29, 2004
    Messages:
    3,324
    Likes Received:
    0
    Location:
    Ft Lauderdale
    I guess I didn't really create a new form I created a new content type with custom fields. Should have described that better. Well now I got the view to display what I want when I hit the preview button. So now I just need to add that view to a custom block and add it to the proper node right? :o
     
  6. k2737

    k2737 Active Member

    Joined:
    Nov 29, 2004
    Messages:
    3,324
    Likes Received:
    0
    Location:
    Ft Lauderdale
    Never mind I am just stupid. On a side not is this the best way to be doing this or should I be doing this another way? :dunno:
     
  7. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    So, you're using CCK? In my opinion, CCK is very messy. I found out that creating the content type, form, and output programmatically is a lot cleaner and would consider it done the "right way" simply because you have full control of your data and you're ensuring the being templated correctly.
     
  8. k2737

    k2737 Active Member

    Joined:
    Nov 29, 2004
    Messages:
    3,324
    Likes Received:
    0
    Location:
    Ft Lauderdale
    Yeah I am using CCK. I will have to check out doing it your way. I have been playing with Drupal for about a week now and it is pretty awesome how customizable it is all through the Admin interface. So far everything I have wanted to do is doable without modifying any code. :bowdown:
     
  9. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    This will be your bible when you begin to learn how to do it programmatically. :)

    http://api.drupal.org/
     
  10. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    I found making forms programmatically much easier than using CCK, but I couldn't get my custom form values to show up in Views :hs:

    actually.. I may have fixed that by upgrading Views.. can't remember :o
     
  11. Mikenotmike

    Mikenotmike

    Joined:
    Jun 1, 2001
    Messages:
    6,244
    Likes Received:
    0
    Location:
    USA

Share This Page