Theodicius

Good. Evil. Bratwurst.

If Drupal’s so easy….

Posted on by arlen

I’ve got some questions for you. Let me first set the stage:

I have new idea for a node type. I’m going to create one that will embed javascript-replayable chess games in a block on a page. Data entry will require uploading two files generated from another application. Both of those files will be slightly modified., and one of them will be parsed into component information chunks.

How do you even begin to write that for Drupal? Note, I already have written php code that can take the files being input and create the chuncks I need. But they are two files, not one, and Drupal only lets you store one blob per node, as far as I can tell.

I’ve spent most of the day trying to figure out how to even start building such a thing, and I’m giving up, now. Maybe it can be done the way I want to do it. I can’t find any information on how, even after going through the tutorial on writing a module. Maybe the way Drupal wants to force me to do it is to lump both files into one, and resplit the files at block-building time, as well as parsing out the rest of the data. Every time the block loads. No. The other choice would be to create the block and just store the block in the blob. Except that a couple of the information bits would be useful for someone looking for the data.

Plus, one bit of the file belongs in the page head, the other belongs where the block will be.

More details:
There are three major components to this. Two are javascript files, one of which remains constant while the other changes with the third component, which is a badly-written HTML file (sorry, can’t do anything about it because it’s the output of a commercial program). The HTML file also contains some things that can be screen-scraped out of it (if the commercial developers had been on the ball, you could parse it out of there) for use elsewhere in the block.

So how about it. Where do I go to tap the ability to create/store node-specific content?

4 Responses to If Drupal’s so easy….

  1. Oh. How quaint. It appears I can’t create a custom content type on my own. I have to locate yet another module and install it just to create a content type for the module I’m trying to write.

    And this is supposed to be easy?

  2. You hafta love the drupal docs.

    Unable to find anything there (mainly because I wasn’t up on my esoteric terminology silly me was searching for content type not node type) Google found me a reference on IBM’s DevWorks site, which was incorrect, but at least gave me a hint that I could eventually follow to better info. Part of the problem was the node_info call, which I now have correct, but which also led to my opening remark.

    In the description of the hook, we find: “Other attributes can also be defined through this hook, but only these ones are required.” What the other attributes are and what their purpose might be is, of course, left completely unsaid.

    It’s the same problem with most open source docs. They’re written by people who are too close to the project to be able to understand how to write for someone who isn’t up to their elbows in the history, philosophy, and terminology of the project.

  3. Oh how I wish you had been at DrupalCampWisconsin… you might have gotten an answer to this question!

    Still, I’m sure there is a way to do it, but as for Drupal being easy, I don’t think that applies as much to module development.

  4. Honestly tried to make it, Pete, but my schedule is written in water. At the last minute things changed and I couldn’t do it, without walking the 8 miles to the site. (MCTS buses don’t like bringing people from the far Northwest side to the east. When I worked at Johnson Controls Glendale, I looked up the bus schedule and I could walk it in less time, because I’d have to do three transfers taking 2.5 hours(!) to travel the 6 miles. So I bicycled instead and it took 20 minutes.)

    I’ve had a longstanding love/hate relationship with Drupal, as you can guess by reading some of my posts. There’s a lot to like about it. But the learning curve for much of it resembles Mount Everest.

    One the one hand, it’s easy to do basic setup and go with it. On the other hand, the more complex tasks are hindered by the fact that most of the docs are written by people too close to the project to understand the issues. They talk and write in shorthand, and until you learn that particular lingo (for which no dictionary can be found) you’re out of luck.

    You see, every project has a “philosophy,” for lack of a better word. It’s a way of approaching problems and tasks. When you grok that, working with the project becomes easier. I’ve always felt there were certain rules/guidelines in Drupal-world that I wasn’t privvy to. Oh, I’ve been able to figure them out, most of the time, when I’ve applied myself to the issue, so they’re not indecipherable.

    But the problem is Drupal seems to wear those idiosyncracies as a badge of honor. (Honestly, one remark I’ve made often is Drupal is what Windows would be if it were a CMS.) It reminds me of the old Unix joke: “Unix *is* user-friendly; it’s just picky about who its friends are.” The Drupal tools don’t fit my hand well, they’re uncomfortable to use.

    A good case in point is the subject of this particular post. I went ahead and built the chess node I talked about here (I tossed the URL your way a couple of days ago). But there was no way for anyone without admin privileges for that node to be able to play through the games!

    I gave up after a little while trying to get past that problem, and went on to more productive endeavors.

    And that’s really the last time I touched Drupal. I feel left-handed in the right-hand world of Drupal. I just don’t grok the underlying philosophy of the work, so everything becomes a little stranger to me, and I in turn become a little clumsier working with it.

    Back in my younger days I would have taken this difficulty as a personal challenge, and pulled all-nighters until I had slain the beast. But I’m crankier now, and less patient with unfriendly software. Now my attitude is more “If the software doesn’t want to do what I want it to do, screw it. I’ll find something else that will.”

    When I’m working with Drupal, I feel like I’m playing one of the early computer adventure games, where I have to guess what word the developer wants me to use in order to find something in the desk I’m searching (“search” doesn’t find anything, neither does “look”, but “examine?”) without enough clues.

    Heck, I even bought a book on Drupal, and all it did was tell me what I could easily figure out for myself, and did nothing to extend my understanding beyond that.

    I’m no novice. I’ve been shuffling electrons around for a living for over a quarter of a century. I’ve no doubt I *can* handle anything Drupal throws at me. The nagging question for me has always been “Why should I?” There are too many alternatives to justify spending a lot of time on that when I could be building Rails sites, or other projects that I understand more completely.

    Still there are attractive bits in Drupal, so I’ll continue to nibble at it from time to time, and curse the developers and writers for reveling in their obscurity. It’s #3 (sliding to #4 as Rails moves up the chart) on my list of tools I’ll use to build websites.

Leave a Reply

Your email address will not be published. Required fields are marked *

It sounds like SK2 has recently been updated on this blog. But not fully configured. You MUST visit Spam Karma's admin page at least once before letting it filter your comments (chaos may ensue otherwise).
March 2007
M T W T F S S
« Dec   Aug »
 1234
567891011
12131415161718
19202122232425
262728293031