PHP

Fixing update_sql() to accept parameters

A pretty simple yet cool feature of Drupal's db_query() function is that you can pass in parameters that will make it automatically adjust the query to correctly escape the arguments. This is one of the simple security features in Drupal as it will properly escape the string to avoid SQL injection attacks, and just simply safe you hassle. Good stuff!

Categories: 

Tags: 

Managing Drupal Views, the proper way

One of the most powerful and most useful modules on Drupal is Views. With one screen you can build custom pages & blocks based around your content, select the exact fields you need, add filters and arguments, and relatively easily customize the display, and that's just scratching the surface. In fact, Views is so flexible that I've built sites which have 90% of their architecture based solely around taxonomies and Views.

Categories: 

Tags: 

menu_link_save doesn't like aliases (drupal)

A quick tip.. while working on an install profile in Drupal I discovered that the menu_link_save() function requires an internal URL, e.g. "node/123" instead of "my-cool-page". Once I tracked down the issue I was able to very easily create lots of menu items as needed, but it wasn't entirely obvious this was needed.

Categories: 

Tags: 

Searching Drupal - my presentation from FLDrupalCamp

Today at the first annual FLDrupalCamp I presented a talk on searching Drupal, covering some gotchas, tips and how to best set up your site for both internal searching (searching when on your site) and external searching (someone searching via e.g. Google). This was knowledge built over my career as a web developer, but primarily during the past eight months working on SkiNet.com.

Categories: 

Tags: 

Pages

Subscribe to PHP