Tag: php

Avoiding the Template.php of Doom (or, Overriding Theme Functions in Modules)

Add CommentShareSource Articles16Monday, June 16, 2008By adminDrupal’s theming system offers developers and designers a flexible way to override default HTML output when specific portions of the page are rendered. Everything from the name of the currently logged in user to the HTML markup of the entire page can be customized by a plugin “theme”. Unfortunately,

Read More
Is that site running Drupal?

These range from super easy stuff like checking for CHANGELOG.txt to checking the source for a reference to “drupal.css” (Drupal 4.7) to checking for common paths like taxonomy/term/1, and /user, (which might be aliased to something else with something like Pathauto/Path Redirect module), and so on. However, since Drupal 4.6, there’s a super geeky trick

Read More
Drupal 6 AHAH forms: The easy way

Comments (2)SourceTutorialsBookmark/Search this post with:Delicious DeliciousDigg DiggStumbleUpon StumbleUponFacebook FacebookGoogle GoogleYahoo YahooTechnorati Technorati28Friday, March 28, 2008By adminToday, I was working with drupal 6’s AHAH form elements. Initially, I was delighted at how well they worked. That delight turned to confusion once I realized that the form elements I had put in the menu callback of the

Read More
Stupid Simple Web Scraping with SimpleXML

Add CommentSourceTutorialsBookmark/Search this post with:Delicious DeliciousDigg DiggStumbleUpon StumbleUponFacebook FacebookGoogle GoogleYahoo YahooTechnorati Technorati20Wednesday, February 20, 2008By adminThe other day, I was tasked with building a data scraper. Having never built such a contraption, I naturally turned to the Internets for preexisting code. I was horrified with what I found. The “free” PHP scripts (that’s “free” as

Read More
Drupal CSS Coding Standards

Add CommentSourceTutorialsBookmark/Search this post with:Delicious DeliciousDigg DiggStumbleUpon StumbleUponFacebook FacebookGoogle GoogleYahoo YahooTechnorati Technorati13Thursday, March 13, 2008By adminOn the #drupal IRC channel, Excallibur points out that there are no coding standards for CSS. I’d like to propose some straightforward ones. Note that I am not intentionally omitting indentation within rules, but am having trouble with my code

Read More
Let Template.php Eat Static

Add CommentSourceBookmark/Search this post with:Delicious DeliciousDigg DiggStumbleUpon StumbleUponFacebook FacebookGoogle GoogleYahoo YahooTechnorati Technorati14Saturday, April 14, 2007By adminMy arch-nemisis is overly complex logic in template.php and page.tpl.php files. It seems to me that when a drupal codebase becomes brittle and unmaintainable, the culprit is usually going to be hundreds of conditional lines of php code in a

Read More
Let Template.php Eat Static

Add CommentSourceTutorialsBookmark/Search this post with:Delicious DeliciousDigg DiggStumbleUpon StumbleUponFacebook FacebookGoogle GoogleYahoo YahooTechnorati Technorati14Saturday, April 14, 2007By adminMy arch-nemisis is overly complex logic in template.php and page.tpl.php files. It seems to me that when a drupal codebase becomes brittle and unmaintainable, the culprit is usually going to be hundreds of conditional lines of php code in a

Read More