News:

Get Out, See Green!

Main Menu

Randomland's Drupal Module

Started by zourtney, Oct 21, 2009, 03:06 PM

Previous topic - Next topic

Nick

Looks good. How much of that is in there? And I think i might be able to help with that stuff. Unless I am underestimating the complexity of it all.

Cool cool!

zourtney

All you can do now is set the image size (and display the image, of course).

So, like [rlimg 1234|preset_name]

zourtney

Im planning to work on this a bit tomorrow. That, and taxes, cleaning up (finding) my desk, packing meat into the freezer, making chili, and enjoying the sun. Hmmm, busy, busy boredom.  :-\

Nick


zourtney

Yeah, I actually finished my taxes (just need to mail the state money AGAIN). And the chili was highly tolerable. There's even a little left. Come get it while it's not moldy!

Oh, and I never got around to working on the rlimg module. I tried, I really did. But I kept falling asleep and not getting back up until the morning. :(

Nick

Falling asleep? I do that almost every day! If only I could avoid it. Just think of all the extra time I would have for being productive! I could not get around to doing twice as many things!

Anyway.  I would definitely be interested in trying your chili some time. 

zourtney

Name a time! Maybe next time we go camping, I'll stew some up during the week before. I cooked this stuff both Saturday and Sunday (in the crock pot). Cooking it longer certainly didn't hurt.

zourtney

#52
More on topic, I worked on the module a little bit, as can be seen on the test site. You can now (w/in-development version) specify the caption, linktitle, and more via XML-style attributes. For example, all of these are valid:

[rlimg 454]
[rlimg  id="454"   ]
[rlimg id="454" linktitle="That's one huge bear!!"]
[rlimg 454 LinkTITLe="Fishing with razor claws is the way to go!" __ignored_attribute="Betch'll ne'er see this!"]
[rlimg 454 preset="800px_wide" alttext="Stream slasher"]


The only loss of functionality is that you used to be able to specify the ImageCache preset using a [rlimg xxx|preset_name] syntax. This was only ever used in about three places, so I figured I'd just go fix them manually when I roll this thing to the live server. (That, and I didn't want to make the regular expression any more complicated.)

The attribute names available are: preset, relpath, fullpath, linktitle, caption, alttext, and gallerylink. And I don't like the name of a single one of them, so please, help me by giving some input on what you think they should be called. :)

Also, the code is now under source control at https://randomland.net/repos/randomland/modules/rlimg.

zourtney

Mmhmm. A resounding "no comment." Ok.

zourtney

I was just thinking, maybe I'll add "float" and/or "class" attributes. Then just call it like:
    [rlimg 1234 class="teaser_img" float="right"]

It'd beat wrapping the thing in a div every time you want to apply rudimentary styling. But perhaps that's just me.

zourtney

#55
Those are now implemented. You can see an example of the attributes in action here. I split each example on to a separate page, because it's less confusing. There are 8.

I think it'll be useful, especially with the alignment property because you can just throw a [rlimg 1234 align="right"] in the middle or your paragraph. It's all on that sample page, too. Let me know what you think.

EDIT: code now committed to the repository at https://randomland.net/repos/randomland/modules/rlimg/

Nick

Dude. That's at least 1.63 times cooler then me. I like it! I will defiantly use it.

zourtney

#57
Haha, um that's a good thing! What other parameters would be useful?

We currently have (in no particular order):

  • preset - sets the imagecache preset. Defaults to "Thumbnail"
  • align - alignment values available are [float] left, [float] right, and center
  • class - a CSS class to apply to the top level of the image block
  • relpath - the relative path to the image (excluding the randomland.net/ This is only used to tell thickbox what to display.
  • fullpath - full path (including the randomland.net/) to the image
  • linktitle - the hover title on the image (of course, Internet Explorer implements ALT tags wrong, so they'll never show in IE..!)
  • caption - the text shown in the annoyingly semitransparent bar at the bottom of the image (subject to styling change: yes!)
  • alttext - should probably be called simply "alt" and is just the ALT text on the img node.

And yes, I'd like to change the variable names. Let me know if you have any naming suggestions before it's too late!

Right now, the thickbox is not allowing for navigation between images in posts when using this module. Does anyone have any idea why that might be? You're supposed to be able to go the prev/next images within that thickbox popup, right?

Nick

I have seen the lightbox one do that. I think they only bo back and forth with images on the page. So they may not be seeing the RLimage thing as an image. Or I could just know nothing about it all. Just a guess.

zourtney

Yeah, that's what I was thinking, but it's just php code. Ulimately it's no different than if I had just made a bunch of img tags myself. Perhaps I have the syntax slightly off?