Hey all,

Will insert_view be updated to use on 5.0 ?

Thanks.

CommentFileSizeAuthor
#1 insert_view.info431 bytesJumpingJack@drupalcenter.de

Comments

JumpingJack@drupalcenter.de’s picture

StatusFileSize
new431 bytes

You need the file "insert_view.info" (is attached) in the insert_view directory.
Content of insert_view.info.

; $Id: insert_view.module,v 1.5 2006/07/04 14:43:58 eaton Exp $
name = insert_view
description = Insert View is a filter that allows users to embed content lists generated by the Views module in node bodies
; version added by drupal.org packaging script on 2006-11-25
version = "5.x-1.x-dev"
; Information added by drupal.org packaging script on 2007-01-01
version = "5.x-1.x-dev"
project = "insert_view"
dependencies = views

Code changes in insert_view.module:

replace $op == 'view' with $op == 'alter' in insert_view_nodeapi

old_code

function insert_view_nodeapi(&$node, $op, $arg) {
if($op == 'view' && function_exists('views_build_view')) {
$node->teaser = _insert_view_substitute_tags($node, 'teaser');
$node->body = _insert_view_substitute_tags($node, 'body');
}

new_code

function insert_view_nodeapi(&$node, $op, $arg) {
if($op == 'alter' && function_exists('views_build_view')) {
$node->teaser = _insert_view_substitute_tags($node, 'teaser');
$node->body = _insert_view_substitute_tags($node, 'body');
}

Ciao

JumpingJack

Julien PHAM’s picture

Seems it doesn't work well... I tried this, but before putting the insert_view module instead of the view I had the code "[view:actualites=3]" instead, of course, and now that I have put and activate the insert_view module with the modifications given in this thread, I have nothing in my node, no view, nothing.

Julien PHAM’s picture

My mistake, it works... that was my view the was messy when I upgraded drupal to 5 version...

greggles’s picture

My attempts at creating a patch for this came out poorly (maybe due to different line endings or something) but the proposed changes worked in my basic testing.

ray007’s picture

The patch works for me too ... maybe it's time to create a new release for drupal 5?

ray007’s picture

first test with the new release seems to work fine for me, guess it's time to set the status to fixed?

one small nitpick: the insert_view.info file could use a line
package = Views
so it shows up with all other views-related modules in the modules administration page.

drewish’s picture

Status: Active » Fixed

it works fine with 5

Anonymous’s picture

Status: Fixed » Closed (fixed)