WEB unofficial drupal thread

Discussion in 'OT Technology' started by White Stormy, Sep 28, 2008.

  1. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    from now on I'll try to keep all my drupal questions/comments to this one thread. if other people do the same we could have a lot of useful info here :bowdown:
     
  2. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    is there a FULL list of drupal variables available to themes? Drupal v5 or earlier has pages with this info.. but I don't see it for drupal v6. I imagine most of the variables are the same, but garland uses one in blocks that I'm not entirely sure about.

    $classes

    does this apply ONLY to blocks? cause after searching google that's the impression I got.. despite the name being kind of unspecific for that. if so, would it be set in template.php? or themeName_settings()? Maybe I'm just tired and I'm overlooking it, but I can't find it anywhere :o
     
  3. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    The variables are directly relational to each template file. ie: page.tpl.php, block.tpl.php, comment.tpl.php, and so on. A lot of the variables are the same, but if you call the variable within a block, then it'll call the variable relative to the block, and not your other template files.

    $classes isn't a variable I'm familiar and doesn't look to be used by Drupal, unless they are defining $classes from template.php. Garland may be defining it there since all custom themeing and theme overriding will be done in template.php.

    If you're using PHPTemplate as your templating engine (which I'd recommend, unless you're familiar with Smarty or something else), here is a list of themeing variables that are called on each template file:

    page.tpl.php: http://drupal.org/node/11812
    block.tpl.php: http://drupal.org/node/11813
    box.tpl.php: http://drupal.org/node/11814
    comment.tpl.php: http://drupal.org/node/11815
    node.tpl.php: http://drupal.org/node/11816
     
  4. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    thanks

    I found it.. apparently I had copied a file over from the Zen theme and not realized it.. I shouldn't work when I'm that tired :o

    $classes is a Zen theme preprocess variable
     
  5. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    I'm trying to do the jQuery example in Pro Drupal Development..

    using the PHP filter input format
    Code:
    <?php
      drupal_add_js(
        '$(document).ready(function(){
          // Hide all paragraphs.
          $("p").hide();
          // Fade them into visibility.
          $("p").fadeIn("slow");
        });',
      );
    ?>
    
    <p id="one">Paragraph one</p>
    <p>Paragraph two</p>
    <p>Paragraph three</p>
    
    but I'm getting this error..

    Parse error: syntax error, unexpected ')' in /home/halefx/public_html/includes/common.inc(1547) : eval()'d code on line 9

    :(
     
  6. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    Are you trying to add that in template.php? I would add it to your page.tpl file instead.
     
  7. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    nah I wasn't programming it in. I was just doing it by creating Page content using the PHP filter input format.
     
  8. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    You should try to leave the node body for plain text and minimal HTML only. By minimal HTML, I mean, sometimes you'll need to use blockquotes, lists, and presentation based elements like those. Leave most of the coding to the actual templating files. If you need any custom coding to your theme done use template.php.
     
  9. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    I was just trying to do the example exactly as he did in the book, to try jquery in drupal :(
     
  10. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    I tried to run it from the Devel Execute PHP box and it didn't work there, either.. :( same, but different, error
     
  11. MikeTheVike1

    MikeTheVike1 OT Supporter

    Joined:
    Aug 29, 2002
    Messages:
    5,840
    Likes Received:
    0
    If I ever get a chance, Lynda.com has a bunch of videos on Drupal. I'm tired of using multiple cms's for different occasions. I need to get real fluent in one good one.
     
  12. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    so is there a best practice for the order of declared hook functions in a module?

    I would normally just do alphabetical order, to make it easier to find them later..
     
  13. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    On the create content pages, underneath the content forms, there are several options like "Revision information", "Comment settings", "URL path settings" (with Pathauto on), "Authoring information", Publishing options, etc..

    I made a module that adds a custom node. I didn't write anything to include those options, but they're there anyway.. so any idea how to get rid of them?
     
  14. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    User preference. :dunno: I'd say display them logically, as your coding the module. But it doesn't really matter.
     
  15. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    I've never done this before, but I believe hook_form_alter() might be able to accomplish this for you.
     
  16. Pepsi1975

    Pepsi1975 Mod of the Year

    Joined:
    Jan 6, 2005
    Messages:
    47,590
    Likes Received:
    1
    Location:
    Detroit
    lmfao at the reasons for post deletes
     
  17. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    thanks

    I basically want a webform that creates nodes.. but want certain roles to have the ability to edit the nodes.. so I came up with this.
     
  18. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    :bigok: I always wonder if anyone looks at those
     
  19. Pepsi1975

    Pepsi1975 Mod of the Year

    Joined:
    Jan 6, 2005
    Messages:
    47,590
    Likes Received:
    1
    Location:
    Detroit
    most people never fill it in
     
  20. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    I ALWAYS fill in something when I delete.. it's usually like "fazle sucks cocks in hell" or something :rofl:
     
  21. Pepsi1975

    Pepsi1975 Mod of the Year

    Joined:
    Jan 6, 2005
    Messages:
    47,590
    Likes Received:
    1
    Location:
    Detroit
    i will pay attention to yours, but the majority of ot doesn't
     
  22. KenIIDX

    KenIIDX New Member

    Joined:
    Nov 9, 2004
    Messages:
    16,943
    Likes Received:
    0
    Is there any way I can get a report of all my users easily without going through each one and manually copying and pasting.

    ie - I'd like to be able to easily export all their usernames and email addresses, info, etc into a spreadsheet

    :dunno:
     
  23. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    if there isn't a module for it already.. it shouldn't be that hard to make one that just dumps it all into a table
     
  24. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    check out the Views module

    and try this example
    http://views-help.doc.logrus.com/help/views/example-users-by-role
     
  25. KenIIDX

    KenIIDX New Member

    Joined:
    Nov 9, 2004
    Messages:
    16,943
    Likes Received:
    0
    Last edited: Oct 8, 2008

Share This Page