Timeline for Views 3 : Set header/footer/empty text for view via views_embed_view
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 1, 2013 at 19:05 | comment | added | tenken |
$view->display['page']->handler->handlers['header'] will have an array of areas. You as the developer need to know with view XXX the right area_N to use. Same thing for footers. The $view is an object check for fields you want, alter them, or add them if you need to.
|
|
Jan 31, 2013 at 16:19 | comment | added | user8753 | how can i know with area i need to use in my php ? i believe it could be the area_1 for each header, footer and empty text ? or the area_1, area_2 etc...for global areas ? | |
Jan 15, 2013 at 21:07 | comment | added | tenken |
It doesnt matter if you use a module. You can call a view from any tpl file using PHP code. You want to set something like: $view->display['page']->handler->handlers['header']['area_1']->options['content'] = "your custom message"; if you want a footer you just set handlers[footer] i believe.
|
|
Jan 15, 2013 at 10:24 | comment | added | user8753 | still there...your example is to complicated for me,i don't use a module, only an php includes files in a custom tpl file to embed my view..actually i would to display header content and footer content from the views UI.. | |
Jan 15, 2013 at 10:12 | comment | added | user8753 | still there...your example is to complicated for me,i don't use a module, only an php includes files in a custom tpl file to embed my view..actually | |
Nov 5, 2012 at 13:55 | comment | added | user8753 | no need to change code for empty text..only footer/header seem to need change whith views 3 | |
Nov 5, 2012 at 13:28 | comment | added | user8753 |
i go ahead with this but my footer doesn't display ,my variable is the right one..$footer_text = '<a href="/node/8" >Voir les archives</a>'; //Pour Views 3 $emptyTextVue_v3 = $view->handler->handlers['header']['area_1']->options['empty'] = TRUE; $FooterV3 = $view->display[$viewdisplay_ag5]->display_options['footer'] = "$footer_text"; i think the issue is in the output of the view actually done with : $output = '<div id="other-sortie"><h3 class="CLASS_NAME">'.$view->get_title().'</h3>' .$view->preview($viewdisplay_ag5,$args_ag5).'</div>';
|
|
Oct 31, 2012 at 3:17 | history | answered | tenken | CC BY-SA 3.0 |