VIEW_DISPLAY

[[VIEW_DISPLAY]]

Outputs the current view using the view template stored in view.tpl at each node level for formatting the rows.

Example: the data file csv_datafeed.txt contains:

name,id,color,size
Washington,1,blue,big
Oregon,2,"green",small
California,3,red,huge

The file, view.tpl contains:

Name: %name%<br />Id: %id%<br />Color: %color%<br />Size: %size%<br /><br />

The Code:

[[LOAD_DATAFEED:csv_datafeed.txt|,]]
[[VIEW_DATAFEED]]
[[cr]][[cr]]Before Sorting by color:[[cr]][[cr]]
[[VIEW_DISPLAY]]
[[VIEW_SORT:color]]
[[cr]][[cr]]After Sorting by color:[[cr]][[cr]]
[[VIEW_DISPLAY]]

Output:

<br /><br />Before Sorting by color:<br /><br />
Name: Washington<br />Id: 1<br />Color: blue<br />Size: big<br /><br />Name: Oregon<br />Id: 2<br />Color: "green"<br />Size: small<br /><br />Name: California<br />Id: 3<br />Color: red<br />Size: huge<br /><br />

<br /><br />After Sorting by color:<br /><br />
Name: Oregon<br />Id: 2<br />Color: "green"<br />Size: small<br /><br />Name: Washington<br />Id: 1<br />Color: blue<br />Size: big<br /><br />Name: California<br />Id: 3<br />Color: red<br />Size: huge<br /><br />

Note that the quoted “green” is a higher sort order than unquoted green.

Leave a Reply