Line view
This page is for designers who style items in lists: children of a folder, search results, latest news. The line view
mode draws one item; node_view_gui calls it for each node.
Contents
What it receives
$node, $view_parameters (offset 0), and any parameter the caller passes
({node_view_gui content_node=$child view='line' image_class='small'}). The kernel's default
design/standard/templates/node/view/line.tpl prints an icon and the linked name.
A teaser example
{* override/templates/line/article.tpl *}
default image_class='small' heading='h3'
<article class="teaser">
if $node.data_map.image.has_content
<div class="teaser-media">attribute_view_gui attribute=$node.data_map.image image_class=$image_class</div>
/if
<$heading class="teaser-title"><a href=$node.url_alias|ezurl>$node.name|wash</a></$heading>
<p class="teaser-meta"><time datetime="$node.object.published|datetime( 'custom', '%Y-%m-%d' )">$node.object.published|l10n( 'shortdate' )</time></p>
if $node.data_map.intro.has_content
<div class="teaser-intro">$node.data_map.intro.content.output.output_text|strip_tags|shorten( 160 )|wash</div>
/if
</article>Headings and links
- The heading level depends on where the list sits: an
h2list title meansh3items. Let the caller pass it (headingabove). - One link per item, on the title; a card whose whole surface is clickable can stretch the title link with CSS instead
of wrapping everything in
<a>.
Per class
An override with Source=node/view/line.tpl and Match[class_identifier]=article gives articles their line
template (Node templates by class). Keep the markup of all line templates similar, so lists
mixing classes look consistent.
Related pages
- View modes
- node_view_gui
- 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.