I am trying to output a view in the footer of another view, using the same argument. PHP Filter is turned on, and this is set to PHP Code.

<?php
$currentview = views_get_current_view();
$currentarg = $currentview-> args[0];
$newview = views_get_view('viewname');
print $newview->execute_display('default', $currentarg);
?>

The output of this is nothing. There isn't any issue I can find that has a simple view called like this.

Many thanks in advance!

Comments

dawehner’s picture

if you just need to embed a view i suggest to use

<?php
print views_embed_view('viewname', 'default', $currentarg);
?>
Timotheus’s picture

Issue tags: +PHP

Eventually I want to dynamically add some extra filters to the view, so views_embed_view won't work for that.

dawehner’s picture

ah ok fine.

Are you sure that args is used right?

Timotheus’s picture

Yes, I can print that arg and it outputs the term correctly.

dawehner’s picture

what for a kind of display are you using?

Timotheus’s picture

I'm using a 'page' display.

dawehner’s picture

could you dsm the output?

esmerel’s picture

Status: Active » Postponed (maintainer needs more info)
dawehner’s picture

You could also try out

$newview = views_get_view('viewname');
// Set dynamic stuff here.
print $newview->preview($display_id, $args);

esmerel’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)
Issue tags: -PHP, -views, -footer, -header, -simple

Automatically closed -- issue fixed for 2 weeks with no activity.