How to hide thumbnail from full node view

5 replies [Last post]
Joined: 03/29/2009
Points: 764

How to hide thumbnail from full node view

Joined: 03/29/2009
Points: 764

Hey y'all,

I might be missing a simple setting somewhere but I can't see where I would hide the thumbnail on the full node display for Kaltura Media Nodes!? I mean, I could probably create a tpl.php page for that node type with an override (haven't heard whether this is possible) or do a css hide but those options seem like work-arounds!?

Any tips?

I would love if this module actually worked with CCK and views like normal/local content - ie. would be nice if I could just jump into the CCK display settings to control the thumbnail vs video player display on teasers and full nodes a la embedded media field module.

q./

Joined: 03/29/2009
Points: 764

Hi,

let me start by saying that overriding with tpl/css is perfectly fine and accepted.
I wouldn't call it work-around, since tpl exists for these kind of changes exactly.

Right now, your options are:
1. use CSS to hide it
2. use tpl.php (should be node-kaltura_entry.tpl.php)
3. use template.php, by overriding the theme_node_kaltura_entry_thumbnail_url function.

Note that the 3rd option, depends on your implementation, might cause thumbnails to not display in other places as well (although you might expect them to).
you can read some more here: viewtopic.php?f=6&t=206

Regarding the "cck like behavior" - the kaltura CCK field acts as a regular CCK field (by means of display options) and there you can set how the field would be displayed.
The Kaltura CCK field is actually an enhanced type of node reference.

Joined: 03/29/2009
Points: 764

A 4:th option:

This hack provides a setting to optionally hide or show the thumbnail from full node view (probably not bullit proof):

in 'modules/kultura/plugins/node_kultura_entry/node_kultura_entry.module'

on line 646 (in the funtion 'theme_node_kaltura_entry_thumbnail_url()')
change:

Code: Select all
return 'kaltura_thumbnail_url . $size_str .'" '. $extra .' />';

to:

Code: Select all
if (variable_get('kaltura_entry_general_display_thumb', 1) == 1) {
return 'kaltura_thumbnail_url . $size_str .'" '. $extra .' />';
} else {
return '';
}

on line 67, in the function 'kaltura_entry_settings_form()')
insert:

Code: Select all
$form['kultura_entry_general'] = array(
'#type' => 'fieldset',
'#title' => 'General',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#weight' => -10,
);
$form['kultura_entry_general']['kaltura_entry_general_display_thumb'] = array(
'#type' => 'radios',
'#title' => t('Display Thumbnail of Media on Node View'),
'#options' => array( 0 => 'no', 1 => 'yes' ),
'#default_value' => variable_get('kaltura_entry_general_display_thumb', 1),
);

This enables a new 'General' setting at 'admin/settings/kaltura/kaltura_entry_settings'.

Joined: 10/06/2009
Points: 16

Gee! That sound great! Why is it not implemented by default?
Would you mind posting the entire code for the node_kaltura_entry.module file here please? I've been trying all afternoon but I get a syntax error...

edit (4info):
With my installation the function theme_node_kaltura_entry_thumbnail_url(...) is at line 605
It ends with:

    return '<div class="kaltura_thumb"><a href="'. url('node/'. $node->nid) .'"><img src="'. $node->kaltura_thumbnail_url . $size_str .'" '. $extra .' /></a></div>';
  else
    return '<div class="kaltura_thumb"><img src="'. $node->kaltura_thumbnail_url . $size_str .'" '. $extra .' /></div>';
}

Nevertheless, I adapt it accordingly and I get a server php error message:

Parse error: syntax error, unexpected '"' in /home/xxxxxx/public_html/sites/all/modules/kaltura/plugins/node_kaltura_entry/node_kaltura_entry.module on line 643

line 643:

    return 'kaltura_thumbnail_url . $size_str .'" '. $extra .' />';
Joined: 10/20/2011
Points: 2

This might help:

  $form['kaltura_entry_image_display']['kaltura_entry_display_thumb'] = array(
   '#type' => 'radios',
   '#title' => t('Display Thumbnail of Media on Kaltura Media Node'),
   '#options' => array( 0 => 'no', 1 => 'yes' ),
   '#default_value' => variable_get('kaltura_entry_display_thumb', 1),
  );

function theme_node_kaltura_entry_thumbnail_url($node, $teaser, $nosize = FALSE, $size = array()) {
...
if ($node->link_thumb || $teaser)
    return '<div class="kaltura_thumbx"><a href="'. url('node/'. $node->nid) .'"><img src="'. $node->kaltura_thumbnail_url . $size_str .'" '. $extra .' /></a></div>';
  else
    if (variable_get('kaltura_entry_display_thumb', 1) == 1) {
      return '<div class="kaltura_thumb_new"><img src="'. $node->kaltura_thumbnail_url . $size_str .'" '. $extra .' /></div>';
    }
    else if (variable_get('kaltura_entry_display_thumb', 1) == 0 && $node->type == 'kaltura_entry') {
      return '';    
    }
}

Bejubel Market Place Terbaik Indonesia