- 3.7. Instructions
3.7.19. opt:section - 3.7.18. opt:root
« Previous - 3.7.20. opt:selector
Next »
3.7.19. opt:section
This chapter describes one of section instructions. We recommend to read Sections first to get to know more about them.
opt:section is the basic section instruction used to display flat, linear lists and supports all the section basic features. Inside the opt:section we define the layout of a single list element:
<ul> <opt:section name="categories"> <li>{$categories.name}, {$categories.productCount}</li> </opt:section> </ul>
Empty lists
We may define the optional content to be displayed if the list is empty with the opt:sectionelse tag:
<ul> <opt:section name="categories"> <li>{$categories.namae}, {$categories.productCount}</li> <opt:sectionelse> <li>We are sorry, there are no categories in the system.</li> </opt:sectionelse> </opt:section> </ul>
opt:sectionelse must be located directly within opt:section, but it is up to you, whether you put it before or after the content.
opt:sectionelse is disabled, if the section is used together with opt:show. In this case, the alternative message can be declared with opt:showelse:
<opt:show name="categories"> <ul> <opt:section> <li>{$categories.name}, {$categories.productCount}</li> </opt:section> </ul> <opt:showelse> <p>We are sorry, there are no categories in the system.</p> </opt:showelse> </opt:show>
See also:
- 3.7.25. opt:tree
- 3.7.10. opt:grid
- 3.7.20. opt:selector
- 3.7.22. opt:show
- 3.7.21. opt:separator
- 3.8.8. opt:section
- 3.7.19. opt:section
3.7. Instructions - « Previous
3.7.18. opt:root - Next »
3.7.20. opt:selector