Archives for “code”

In the course of developing Drupal for the DP, we’ve been fortunate that we’ve had to write very little (themeing layer excepted) from scratch. Chalk it up to to the strength and robustness of the Drupal community that nearly every function we wanted, there was a module for.

One module that I did have to write from scratch was to replicate a function from College Publisher. After copy and pasting a story into CP’s interface, there was a button run all that doubled the line breaks, among other things.

Drupal wraps text separated by two line breaks with <p> tags and uses the <br /> tag to in-between text separated by one line break. By default, text copied out of InCopy only has one line break between paragraphs.

When Sean Blanda posted about the Temple News moving to Wordpress, this was one of the 6 problems he laid out as having.

Keep reading…


Since College Publisher doesn’t give its clients access to their own databases or the web server, to do many things (like adding any new feature) requires working around it on auxiliary servers they provide running LAMP.

One feature that CP desperately needs is the ability to create a block of related stories.

So I struggled with the problem a little bit and created a little script to let totally non-tech savvy editors create a block of code to paste in.

You can see a demo of it here.

Related links generator

The source code is here. To run it, your server must allow fopen to open url’s.

Source

This is the first time I’ve released the code of anything I’ve written, so give me some feedback!