Okay, I finally got this to work--only to discover that the real problem is not the images; I think it is a glitch in the view module.

What's happening: The view module is pulling content from blog entries and is set to trim the number of characters. If a blog entry contains an image, the result is that the blog entry is cut and the output is "/p". If an image is the first item in the blog, the output can be entirely cut and only the "/p" is output.

What I've tried: A million things that aren't relevant; but for reference, I did remove all end tags for my paragraphs to make sure that this was not the problem. There are no paragraph end tags in the blog entry or in the source code for the page but the output is still "/p"

Issue #1: Trying to solve this issue, I also noticed that the view module's trim function includes tag contents in its character count. This will likely not matter if the trim is say 500 characters, but if it's smaller (100 or less) the tags could drastically reduce the characters read in (and output) by the module.

Issue #2: The view module has a setting that allows fields to be limited to a certain number of characters. When that setting is active, I have the "/p" problem. When it is inactive and the field is untrimmed, the problem goes away. Further, the problem only arises if the paragraph is trimmed AFTER an image has been included; if the trim occurs prior to the introduction of an image tag, no problem. This leads me to believe the problem lies in the way the module is interpreting the tags; if so, could indicate a larger issue. (Then again, I'm a newbie so it could just be me.)

Replication info: The view is being displayed as a block. The images are hard coded in the blog entry (NOT using imagefield) for a whole host of reasons.

Replication info:

  • The view is being displayed as a block.
  • The images are hard coded in the blog entry (NOT using imagefield) for a whole host of reasons.
  • Drupal 6.10
  • CCK 6.x-2.2
  • Views 6.x-2.4
  • Can anyone replicate the problem? Any ideas on this?

    SELECT node.nid AS nid, node.title AS node_title, node.changed AS node_changed, node_revisions.teaser AS node_revisions_teaser, node_revisions.format AS node_revisions_format, node.created AS node_created FROM d1t_node node LEFT JOIN d1t_node_revisions node_revisions ON node.vid = node_revisions.vid WHERE node.status <> 0 ORDER BY node_created DESC

$view = new view;
$view->name = 'testv';
$view->description = '';
$view->tag = 'testv';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'title' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
    ),
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'changed' => array(
    'label' => 'Date',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
    ),
    'date_format' => 'small',
    'custom_date_format' => '',
    'exclude' => 0,
    'id' => 'changed',
    'table' => 'node',
    'field' => 'changed',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'teaser' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 1,
      'max_length' => '600',
      'word_boundary' => 1,
      'ellipsis' => 0,
      'html' => 1,
    ),
    'exclude' => 0,
    'id' => 'teaser',
    'table' => 'node_revisions',
    'field' => 'teaser',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('sorts', array(
  'created' => array(
    'order' => 'DESC',
    'granularity' => 'second',
    'id' => 'created',
    'table' => 'node',
    'field' => 'created',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('empty', 'No recent posts.');
$handler->override_option('empty_format', '1');
$handler->override_option('items_per_page', 7);
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);

Comments

merlinofchaos’s picture

Looks like another http://drupal.org/node/382278

Also, 'needs review' should only be used when a patch is attached.

merlinofchaos’s picture

Status: Needs review » Closed (duplicate)
tempd5’s picture

Apologies on status. I'm only 2 days old in the forums.

merlinofchaos’s picture

No worries on the status. It used to be patch (needs review) and I think this is an example of why it needs to be changed back. Thanks.