• Welcome to Randomland - The Forum. Please login or sign up.
 
May 01, 2024, 05:00 AM

News:

Get Out, See Green!


Image System Bugs and Suggestions

Started by zourtney, Nov 04, 2009, 03:58 PM

Previous topic - Next topic

Nick

http://test.randomland.net/drupal/img

Minor update to the status of the imaging system. I looked up how to work the "image style" system in drupal 7 and used it in the theme for the gallery view to produce some rough thumbnails. Next will be to change how the formatting is done to get the grid items close together. 

zourtney

There are also ways to specify the display format of File (module) types. I think it's overly generic, but I could be wrong. All I know is that they exist. Might be worth looking into...

Nick

Show the documentation and I will play with it!

zourtney

I only skimmed it, but this is what I was referring to:

http://drupal.org/node/1242904

Sounds like it might be a generalized version of what we'd have to do.

Nick

That's for video. I think we will be ok using the built-in function for the images. All you need is the uri for the file, and those are easy to come by using views or the whole file path.

What we might need is a way to use the media ID to get the uri though.

Also, they just started a new branch of the media module. They are using a 'file entity' sister module now. Not sure what this will change. Probably just have to use a different function to get at the uri and field values.

zourtney

Whatever is going on in Configuration -> File Types, I don't understand....

Nick

Configuration -> Media -> File Types ?

A poorly designed interface for changing how the files are displayed in various contexts (mostly for use when putting files into posts using the wyswyg editor.) And for adding fields to the file types like any other content type. Its confusing. I think there is a way to use those view modes in custom places (php code) but I don't know what does that.

I deleted most of the different view types and mostly got it to use the default.

I have found that $file = file_load($fid); will fetch a file entity (or file node. I an not sure what to call them) with all its goodness and fields in an object. Then with $image = array(
  'style_name' => 'thumbnail',
  'path' => $file->uri,
  'width' => '',
  'height' => '',
  'alt' => "Poots",
  'title' => "Pots",
  );
print theme('image_style',$image);


You can make a thumbnail. Or any other size image based on a preset.

zourtney

Ok cool. That is the standard method for invoking a theme template. I used that in the old rlcore code. Should we create our own version of that image template which overrides this? That makes more sense than what I was doing -- wrapping/recreating such a template.

That still doesn't take care of the I input filter, but yeah.

Nick

Either way. I have no idea how to override/add to the template. I suppose it wouldn't be too hard, just implement some hooks or something in a module. But these are things I am still trying to lean.

I think I will make a temporary gallery setup with views, just using some php and template files. I am hoping at least some of the effort there will be of use with the RL module. Most of the php could eventually be replaced with a simple call to the RLimg module. And then the markup for the layout might be a starting point for a view that the module could create.


zourtney

Yep, that sounds good. Sorry I haven't gotten much done on that input filter part. Maybe I'll find some time within the next few days. It won't take long...I'm just busy procrastinating.

zourtney

Aug 22, 2011, 03:48 PM #85 Last Edit: Aug 22, 2011, 03:50 PM by zourtney
Out of Drupal-induced anguish, I tried installing Wordpress again. I slapped on a few plugins. Puzzled, I soon said, "um, wow, this kinda actually works."

I got a basic, taggable image system in place. You do BBCode-style text to display images by tag (Wordpress calls this "shortcode" syntax). You can use the admin pages to search and image names, tags, and body text.

Perhaps I've lowered my standards a bit, but this beats what we have no on both D6 and D7. Strangely, the part Nick has been working on in D7 is the part I haven't yet found a good, standalone module for -- a user-facing search/display page. But honestly, if we are to write* module code, I'd rather do it for Wordpress. The other obvious missing piece is a single-image embedment syntax (ala rlimg). Both of these exist in some for or another in other plugins, though may be incompatible. But we can dig/code more if we trait-upon das Dries.

true story: as I was writing that sentence, my phone autocorrected "towrite" to "torture". Coincidence? I think not.

Edit: oh yeah, test.randomland.net/wp