Skip to main content

Home/ Drupal for Developers/ Group items tagged nodes

Rss Feed Group items tagged

Hendy Irawan

Drupal Development - 0 views

  •  
    Drupal Development - Presentation Transcript Drupal Code: Day 1 where am i, and how did i get all these arrays Hi. I'm eaton. Drupal is... http://www.flickr.com/photos/druclimb/282597447/ Drupal is... Drupal Core http://www.flickr.com/photos/druclimb/282597447/ Drupal is... Node Drupal Core User http://www.flickr.com/photos/druclimb/282597447/ Drupal is... Views Five Star CCK Node Drupal Core User http://www.flickr.com/photos/druclimb/282597447/ Drupal is... Theme Views Five Star CCK Node Drupal Core User http://www.flickr.com/photos/druclimb/282597447/ Drupal is... Theme Views Five Star CCK Node Drupal Core User http://www.flickr.com/photos/druclimb/282597447/ name = Demo description = Just a simple demo module. core = 6.x function demo_nodeapi(&$node, $op) { global $user; if ($op == 'view') { if ($node->uid == $user->uid) { $node->title . ' [YOUR ARTICLE]'; } } } demo.info demo.module name = Tricky description = A slightly trickier module. core = 6.x function tricky_form_alter(&form, $form_state, $id) { if ($id == 'node_form') { $title['#required'] = FALSE; } } function tricky_install() { drupal_set_message('You just installed Tricky!'); } tricky.info tricky.module tricky.install views.info views.module views.inc user.inc node.inc blog.inc comment.inc ui.info ui.module arguments.inc handlers.inc filters.inc query.inc sprout.info sprout.module forum.inc views.pages.inc table.inc views.install sprout.install sprout.admin.inc sprout.inc CHANGELOG README views.info views.module views.inc user.inc node.inc blog.inc comment.inc ui.info ui.module arguments.inc handlers.inc filters.inc query.inc sprout.info sprout.module forum.inc views.pages.inc table.inc views.install sprout.install sprout.admin.inc sprout.inc CHANGELOG README views.info views.module views.inc user.inc node.inc blog.inc comment.inc ui.info ui.module arguments.inc handlers.inc filters.inc query.inc sprout.info sprout.module forum.inc views.pages.inc table.inc views.install
Scott Blackburn

How to have a content type use a different page layout? | drupal.org - 0 views

  • function newsflash_preprocess_page(&$variables) {  if ($variables['node']->type == "static") {       $variables['template_files'][] = 'page-node-static';  } elseif ($variables['node']->type == "news") {        $variables['template_files'][] = 'page-node-news';  } elseif ($variables['node']->type == "codes") {        $variables['template_files'][] = 'page-node-codes';  } elseif ($variables['node']->type == "jokes") {        $variables['template_files'][] = 'page-node-jokes';  } }
anonymous

Free your content of PHP: Moving PHP code out of blocks, views and nodes | 2bits.com, I... - 2 views

  • From the early days, Drupal had the ability to embed PHP code in its content. This provides flexibility and functionality, most importantly, nodes and blocks can contain dynamically fetched data from the database using custom queries and displayed them in other content. This is an easy approach to get such data without writing a module. All you need to do is assign the PHP input format filter to the node or block and paste your PHP code in it, and voila, you have dynamic content. Code in Content: the issues However, this approach is suboptimal and has serious drawbacks, including:
  •  
    From the early days, Drupal had the ability to embed PHP code in its content. This provides flexibility and functionality, most importantly, nodes and blocks can contain dynamically fetched data from the database using custom queries and displayed them in other content. This is an easy approach to get such data without writing a module. All you need to do is assign the PHP input format filter to the node or block and paste your PHP code in it, and voila, you have dynamic content.
Daniel Gregoire

Programmatically create a CCK node | Eric's Drupal Blog - 6 views

  •  
    Programmatic CCK nodes: node properties.
Scott Blackburn

Limit Views-created block content by node author or current node | Geeks & God - 0 views

  •  
    Scenario One: Limit by author of current node Scenario Two: Limit source to CCK fields in the current node
Scott Blackburn

Getting node path for theming list view | drupal.org - 0 views

  •  
    I recently need to theme a node path in a list view. Comment #1 did the trick: $node = node_load($nid); $path = drupal_get_path_alias('node/'.$node->nid);
Daniel Gregoire

Programmatically Create, Insert, and Update CCK Nodes | doug | CivicActions - 2 views

  • Always use content_database_info to get the database info. For example:   $field1 = content_database_info(content_fields('yourfield1', 'yourtable'));  $table1 = $field1['table'];  $column1 = $field1['columns']['value']['column'];  $field2 = content_database_info(content_fields('yourfield2', 'yourtable'));  $table2 = $field2['table'];  $column2 = $field2['columns']['value']['column'];  if ($table1 == $table2) {    $sql = "SELECT n.*, t1.$column1, t1.$column2 FROM {node} n ";    $sql .= " INNER JOIN {$table1} t1 ON t1.nid = n.nid AND t1.vid = n.vid";  }  else {    $sql = "SELECT n.*, t1.$column1, t2.$column2 FROM {node} n ";    $sql .= " INNER JOIN {$table1} t1 ON t1.nid = n.nid AND t1.vid = n.vid";    $sql .= " INNER JOIN {$table2} t2 ON t2.nid = n.nid AND t2.vid = n.vid";  }  $sql .= " WHERE n.nid = %d";
  •  
    Important point: Using special functions to let CCK get the proper name of the field (allowing users to make CCK changes in the UI and let your code continue to work).
Scott Blackburn

The node rendering solution | jeff eaton - 0 views

  •  
    The node rendering solution Published July 31, 2006 - 1:22am Tags: drupal | geekery | patches Jeff's blog
Daniel Gregoire

Restrict specific folders from public download (via .htaccess) | drupal.org - 0 views

  • If you set "public" as the download method, you can still protect some of your folders by settings in your .htaccess file, if you have mod_rewrite enabled. For instance, if your files live in sites/default/files, and you want to protect everything in sites/default/files/protected_download_dir, then you can add the following line to your central .htaccess file: RewriteRule ^sites\/default\/files\/(protected_download_dir\/.*)$ index.php?q=system/files/$1 The files in this folder (or, all files that match the regular expression) will not be served directly by apache, but by a full drupal request using the file_download() callback. The routing for system/files is defined in system_menu(). Access Checking for File Downloads Modules can do access checking on files downloaded through file_download(), by implementing hook_file_download(). For instance, the filefield module will do access checking for all files that you upload via filefield. It will only give access to people who are allowed to see the node and the field the file belongs to. In addition, you can look for modules that restrict file downloads based on the folder name or other criteria. Access Checking built-in with Filefield The filefield module has access checking built-in. To make use of this, please Make sure to use the latest dev version of filefield (for now). The current offical release (08/2009) has a bug in access checking. Have a look into filefield issue 516104. Configure the filefield you want to protect. Use the filefield path module, to define where the files for the filefield should be stored by default. Add a line to your .htaccess to protect this folder (see above). Use whatever modules to restrict node or field access.
Scott Blackburn

How to make CCK fields do some of the same tricks as taxonomy terms | !&# - 0 views

  • In Drupal, taxonomy.module implements hook_term to provide links among content which shares a given term. Site builders often use this feature to provide indexes and RSS feeds of their content. Taxonomy.module's purpose is to support the creation of controlled vocabularies which we can use to classify our site's content. If taxonomy.module were a prescription drug, this would be its "on-label" or indicated use. Using taxonomy.module vocabularies and terms to store essential data about our content is what I call an "off-label" use. You're not really creating a controlled vocabulary, and the term-node relationship in these cases isn't always classificatory. However, a clever web developer will use the tools that get the job done, and often taxonomy.module is the perfect tool for making this happen. Because this information is essential to your node's content, CCK fields are indicated for this use. However, CCK fields don't have built-in linking among nodes which share values for the same field. Also absent is any built-in RSS feed for a CCK field's value. This requires some theming and Views.
Scott Blackburn

Feed API + Emfield Recipe | drupaltherapy.com - 0 views

  •  
    Here is a quick recipe that uses Drupal's Feed API, Feed Element Mapper, CCK and the Embedded Media Field to create independent embedded video nodes on your Drupal site by RSS. This is our first screencast and first contribution to the Drupal Dojo, hopefully you will find this interesting and try it out yourself.
Scott Blackburn

Anonymous user permissions when integrating with OG | drupal.org - 0 views

Daniel Gregoire

Load Testing Tools and Tips | Tag1 Consulting, Inc. - 1 views

  • ApacheBench (ab)
  • $ ab -n1000 -c10 http://localhost/
  • Links: Project's web page: http://httpd.apache.org/docs/trunk/programs/ab.html Benchmarking Drupal code with ab: http://drupal.org/node/79237
  • ...5 more annotations...
  • Siege
  • siege -c 10 -i -t 5m -d 3 -f url_list.txt
  • Links: Project's web page: http://www.joedog.org/JoeDog/Siege Sproxy project page: http://www.joedog.org/JoeDog/Sproxy
  • Apache JMeter
  • Links: Project's web page: http://jakarta.apache.org/jmeter/ Load testing Drupal with JMuery, part 1: http://www.johnandcailin.com/blog/john/load-test-your-drupal-application... Load testing Drupal with JMuery, part 2: http://www.johnandcailin.com/blog/john/load-test-your-drupal-application...
  •  
    Load testing tools. ab and siege are command-line, JMeter is graphical (and written in Java).
Richard Sheppard

Drupal: Programmaticaly creating nodes | Unofficial, unsactioned stuff out of Byte Craft - 2 views

  •  
    A rough guide to drupal_execute() versus node_save() with a bit of node_submit() on the side.
Daniel Gregoire

Wrapper ID (form-item) not displayed for Checkboxes / Radio Buttons CCK Fields | drupal... - 1 views

  •   if (!empty($element['#id'])) {    $output .= ' id="'. $element['#id'] .'-wrapper"';  }  else { // if we can't get the #id from $element['#id'] just build it from $element['#name']    $id=explode("[value]", $element['#name']);    $output .= ' id="'. $id[0] .'-wrapper"';  }
  •  
    Small fix for giving radio/checkbox form elements a proper ID on their wrapper. By default in 6.16 and CCK, no proper CSS ID is given to the wrappers of radio buttons and checkboxes, making it impossible to theme the layout of those elements in the form (specifically for me, the node edit forms).
Daniel Gregoire

AJAX-ifying Drupal Node Forms | Stella's Website - 8 views

  •  
    Another tutorial on adding AJAX to Drupal 6 forms with FAPI. Based on poll.module like others. This process is not as straightforward as some, which is why it has been improved upon in D7.
Razvan P

Visual Website Optimizer: Another Way To Run A/B Tests On Your Site - 0 views

  •  
    A/B testing for Drupal nodes.
1 - 20 of 174 Next › Last »
Showing 20 items per page