node_view_gui
This page is for designers who draw lists of content: the children of a folder, search results, related articles. Use
{node_view_gui} to draw each node in a view mode; the override system then picks the right template per class.
Contents
Use
<ul class="article-list">
foreach $children as $child
<li>node_view_gui content_node=$child view='line'</li>
/foreach
</ul>The template used is node/view/line.tpl, or an override for that view and the node's class.
What the template receives
$node (the node), and $view_parameters with offset 0 by default (from the function's definition in
kernel/common/eztemplateautoload.php). Note: not $module_result, and not the variables of the calling template other than
those passed as parameters.
Override keys
node, object, class, class_identifier, class_group, section, section_identifier, state,
state_identifier, parent_node, depth, url_alias, remote_id, node_remote_id, parent_class_identifier,
parent_node_remote_id, parent_object_remote_id. So a rule can give articles inside a "News" folder a different line
view than articles elsewhere (Override by parent).
Extra parameters
Every other parameter becomes a variable in the view template:
node_view_gui content_node=$child view='line' image_class='small' show_date=true()and in the line template: {default image_class='medium' show_date=false()}.
Why not include?
node_view_gui | include | |
|---|---|---|
| per class templates through overrides | yes | no |
| other designs can restyle one class | yes | only by replacing the whole part |
| view mode reused elsewhere (layouts blocks, search) | yes | no |
Related pages
- View modes
- Line view
- Node templates by class
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.