Can we have an option (or just change) the flexinode tabular view in a way that image fields could be showed with the real image, instead of a link to the image?

Comments

Marc Bijl’s picture

It's possible to create a node-flexinode-n.tpl.php file, where n is the id of the flexinode type. Using this file you're 100% free to design the flexinode page the way you like.

You can find some information about this here:
- http://drupal.org/node/31646#comment-63439
- http://drupal.org/node/32746.

For me it worked quiet well, look at this flexinode page:
- www.newoceans.nl/en-local/website-design/portfolio/website-thuisverzorgd

The same way, all the internal links from my sidebar lead to flexinode pages.

Hope this can help...

bluecobalt’s picture

That's for theming a flexinode page. Extremely useful, but not for theming a tabular view.

Does anyone know how to do this? I need this as well. Have tried altering the code with no success.

thanks,
blue

magico’s picture

When we view a list of flexinodes for example "/flexinode/table/1" if we have an image field it shows up in the list as a link to the real image. AFAIK, it's not possible to theme flexinode tabular view...

magico’s picture

For now I changed field_image.inc to the following

function flexinode_field_image_format($field, $node, $brief = 0) {
  $fieldname = 'flexinode_'. $field->field_id;
  $file = is_object($node->$fieldname) ? $node->$fieldname : unserialize($node->$fieldname);
  if ($file) {
    if ($brief) {
      // return '<a href="'. file_create_url($file->filepath) .'">'. check_plain($file->filename) .'</a> ('. format_size($file->filesize) .')';
      return '<img src="'. file_create_url($file->filepath) .'" alt="'. check_plain($node->title) .'" />';
    }
    else {
      return '<img src="'. file_create_url($file->filepath) .'" alt="'. check_plain($node->title) .'" />';
    }
  }
}
bluecobalt’s picture

excellent! thank you.

Marc Bijl’s picture

Sorry guys, misunderstood...

Now I see what you mean with tabular view: the view in drupal's administration. I thought it was about themed flexinode pages using tables.

Good to hear you're fine now!

Cheers :)

ngstigator’s picture

I've replaced the function in field_image.inc as per magico's code, but no change in behaviour. In fact, I've tried removing that function altogether and it doesn't seem to make a difference at all.

Just to clarify, I'm trying to make a flexinode field of type "image" to show in table view. This field is linked to an image gallery (via a custom content type).

Any suggestions are welcome.

ngstigator’s picture

Please ignore my previous post. I was able to upload individual images instead of linking to a gallery.

Bèr Kessels’s picture

Component: Code » Field type: image
Status: Active » Fixed

According to the comments, this issue is solved.

Anonymous’s picture

Status: Fixed » Closed (fixed)