Hi

I use the embed method to put view'block into node-custom.tpl...but i've a problem with the date content.
I have a date exposed filter on the year, as it is set on "now" and i've no content yet, all the view content isn't displayed, instead of i've content for 2011...
so i think it's an error from embed views...what is the way to display the view even if the current year doesn't have content ?

thanks

Comments

kars-t’s picture

Status: Active » Fixed

Dear fellow Drupal enthusiasts,

this issue is now lasting for a very long time in the issue queue and was unfortunately never solved. As Drupal is a open source project everyone is helping on voluntary basis. So that this is was not solved is nothing personal and means no harm. But perhaps no one had time to deal with this issue, maybe it is too complex or did not pose the problem comprehensible.

But this issue is not the only one. There are thousands of issues on Drupal.org that have never been worked on or could not be processed. This means that we are building a wave that is unmanageable and just a problem for the Drupal project as a whole. Please help us keep the issue queue smaller and more manageable.

Please read again, "Making an issue report" and see if you can improve the issue. Test the problem with the current Core and modules. Maybe the problem doesn't exist anymore, is a duplicate or has even been solved within this issue but never closed.

Help can also be found for it on IRC and in the user groups.

In order this issue no longer remains, I put this issue to "fixed".

If there is new information, please re-open the issue.

Status: Fixed » Closed (fixed)

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

aiphes’s picture

Version: 6.x-2.9 » 6.x-3.0
Status: Closed (fixed) » Active

trying to embed views with exposed filter but doesn't work :

$viewname_ag1 = 'Actualites_liste_globale';
$view = views_get_view ($viewname_ag1);
$viewdisplay_ag1 = $view->set_display('block_1');
//$args_ldj1 = $view->set_arguments(array($node->nid));

//$emptyTextVue = $view->display_handler->get_option('empty');
$emptyText = $view->display_handler->set_option('empty','<div class="vue-txt-vide">Pas de contenu à afficher pour cette année.</div>');

//Filtre exposé
// The $exposed_filters keys must correctly correspond with the actual keys of your view's exposed filters.
$exposed_filters = array(
  'node_data_field_date_evenement.field_date_evenement_value' => 'node_data_field_date_evenement.field_date_evenement_value',
  'term_node_tid_depth' => 'All',
);
// Pass in exposed filter values. array_merge() order prioritizes user input.
$view->exposed_input = array_merge($exposed_filters, (array)$view->exposed_input);
$view->exposed_raw_input = array_merge($exposed_filters, (array)$view->exposed_raw_input);
$view->exposed_data = array_merge($exposed_filters, (array)$view->exposed_data);
  

//Exécution de le vue
$view->pre_execute();
$view->execute();

if (!empty($view->result)) {
   
  // S'il y a un resultat on récupère le titre (ajoute tag h3, et le contenu)
  $output = '<div id="bloc_actus_globales"><h3 class="classe-h3">'.$view->get_title().'</h3>' .$view->preview($viewdisplay_ag1).'</div>';

  //Affiche la vue si contenu
print $output;
}
//sinon affiche texte vide
elseif (empty($view->result)) {
       //Formatage du texte vide,ajout du titre de la vue
     $outputEmpty = '<div id="bloc_actus_globales"><h3 class="classe-h3">'.$view->get_title().'</h3>'.$emptyText.'</div>';
    // $outputEmpty = '<div id="bloc_actus_globales"><h3 class="classe-h3">'.$view->get_title().'</h3>'.$emptyTextVue.'</div>';
    // drupal_set_message('$EmptyTextVue : '.$emptyTextVue.'status');
     //Affichage du texte vide
  print $outputEmpty;
}

i don't know how to set filters like in my views, so how can i get the array's values from my view in the exported code ?

thanks

mustanggb’s picture

Issue summary: View changes
Status: Active » Closed (outdated)