Views of Users and Images

ebeyrent - October 16, 2007 - 17:48
Project:Usernode
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I am using Usernode for custom user profiles, and Image Attach for attaching the image to the user profile. Now, I am trying to create a View that shows the username and attached image, but am hitting a wall.

If I have Node: ID, Image Attach: Display Image, and Usernode: User ID as fields, I get nothing. If I get rid of the Usernode: User ID field, I get a list of nodes, even if they don't have attached images.

Ultimately, I want to display a view of blog posts consisting of Node title, username, attached image, and node body.

Any tips for getting this all to work?

#1

ebeyrent - October 17, 2007 - 15:54

I know I can retrieve the image in the template code, but I'd love to be able to do this through the admin interface.

#2

drewish - October 17, 2007 - 16:55

the image attach module should present the attached image as a field option... is that not working for you?

#3

drewish - October 17, 2007 - 16:57

also, if you only want nodes with attached images you need to enable the 'Image Attach: Attached image' filter.

#4

drewish - October 17, 2007 - 16:58
Project:Image» Usernode
Version:5.x-1.5» 5.x-1.x-dev
Component:image_attach» Code

it sounds like your problem is really with usernode integration so i'm moving this issue to that queue.

#5

ebeyrent - October 17, 2007 - 18:25

It's just not working. Here is the exported view:

<?php
  $view
= new stdClass();
 
$view->name = 'latest_forumtopic';
 
$view->description = 'Shows the very latest forum topic posted on the system';
 
$view->access = array (
 
0 => '2',
);
 
$view->view_args_php = '';
 
$view->page = TRUE;
 
$view->page_title = 'Recent forum topic';
 
$view->page_header = '';
 
$view->page_header_format = '1';
 
$view->page_footer = '';
 
$view->page_footer_format = '1';
 
$view->page_empty = '';
 
$view->page_empty_format = '1';
 
$view->page_type = 'list';
 
$view->url = 'node/latestforum';
 
$view->use_pager = FALSE;
 
$view->nodes_per_page = '1';
 
$view->menu = TRUE;
 
$view->menu_title = 'Recent posts';
 
$view->menu_tab = FALSE;
 
$view->menu_tab_weight = '0';
 
$view->menu_tab_default = FALSE;
 
$view->menu_tab_default_parent = NULL;
 
$view->menu_tab_default_parent_type = 'tab';
 
$view->menu_parent_tab_weight = '0';
 
$view->menu_parent_title = '';
 
$view->block = TRUE;
 
$view->block_title = '';
 
$view->block_header = '';
 
$view->block_header_format = '1';
 
$view->block_footer = '';
 
$view->block_footer_format = '1';
 
$view->block_empty = '';
 
$view->block_empty_format = '1';
 
$view->block_type = 'list';
 
$view->nodes_per_block = '1';
 
$view->block_more = TRUE;
 
$view->block_use_page_header = FALSE;
 
$view->block_use_page_footer = FALSE;
 
$view->block_use_page_empty = FALSE;
 
$view->sort = array (
    array (
     
'tablename' => 'node',
     
'field' => 'changed',
     
'sortorder' => 'DESC',
     
'options' => 'normal',
    ),
    array (
     
'tablename' => 'node',
     
'field' => 'created',
     
'sortorder' => 'DESC',
     
'options' => 'normal',
    ),
  );
 
$view->argument = array (
  );
 
$view->field = array (
    array (
     
'tablename' => 'image_attach',
     
'field' => 'iid',
     
'label' => '',
     
'handler' => 'image_attach_views_handler_field_iid',
     
'options' => 'thumbnail',
    ),
    array (
     
'tablename' => 'node',
     
'field' => 'title',
     
'label' => '',
     
'handler' => 'views_handler_field_nodelink_with_mark',
     
'options' => 'link',
    ),
    array (
     
'tablename' => 'users',
     
'field' => 'name',
     
'label' => '',
    ),
  );
 
$view->filter = array (
    array (
     
'tablename' => 'node',
     
'field' => 'type',
     
'operator' => 'OR',
     
'options' => '',
     
'value' => array (
 
0 => 'forum',
),
    ),
  );
 
$view->exposed_filter = array (
  );
 
$view->requires = array(node, image_attach, users);
 
$views[$view->name] = $view;
?>

I'm admittedly new to Views, and just can't see where I've gone wrong.

 
 

Drupal is a registered trademark of Dries Buytaert.