GoogleDDGWikipediaTwitterGithubEALWWorld ProblemsPubPub

layout: post title: Testing Purple created: 1183528129 categories:

From Facebook apps to photos stored on Flickr, we want to have all our "stuff" just magically collected together wherever we happen to be, whatever network we happen to be interacting with. Aggregation, sucking this content in, pushing it over there -- all just temporary ways of flowing content around. One that arguably duplicates content and spews extraneous permalinks around. I just want my pictures right here, or I just want to link deep into someone else's posting and pull in a piece of text. And I want the "other end" to know about that inclusion, a gentle ping, yeah, kind of a trackback. That's the Semantic Web to me: where every plain old HTML file is dynamic and intelligent and knows about the links and people that are incoming and outgoing.

OK, now to Purple. Here's an example that includes a file I have on my server, shamelessly copied from the purple-include examples page. First the code:

<hx:include src="/sites/!//p"></hx:include>

And now the transcluded bit:

<hx:include src="/sites/!//p"></hx:include>

Update: Kevin reports that the transclusion doesn't work in Safari. Stupid client side technologies :P

Note: I don't *actually* know XPath. But if you open the file directly, you'll see it just grabbed the paragraph. I'm assured you can do more complicated things than that :P

To Do: #

Here's pretty much the entire "meat" of the module, which does nothing but include some JavaScript and CSS:

function purple_footer() {
  $path = drupal_get_path('module', 'purple');
  drupal_add_css($path .'/purple.css', 'module', 'screen');
  drupal_add_js($path . '/purple-include.js','module');

That was fun, and somewhat therapeutic. It's only going to get really interesting when I grab the proxy code. Oh, and of course, I'm typing in bare HTML here and turning off the WYSIWYG which eats funky hx-namespaced code for breakfast.

Oh yes, and to the various folks I've bumped into that tell me "Sometimes I have no idea what you're talking about"...well, sorry, this is probably one of those posts :P