Feature #5933
Optional section rendering
| Status: | Accepted | Start date: | 2010-06-18 | ||
|---|---|---|---|---|---|
| Priority: | Should have | Due date: | 2010-06-25 | ||
| Assignee: | Sebastian Kurfuerst | % Done: | 20% |
||
| Category: | ViewHelpers | ||||
| Target version: | - | Estimated time: | 2.00 hours | ||
| Has patch: | No | ||||
| Votes: | 0 |
Description
It would be nice to be able to make a section optional.
If a template does not define the "food" section, then the default food will be shown if optional is set:
<f:render section="food" optional="true">
<p>Default food: potato chips</p>
</f:render>
If a default value is not set, then it will render nothing:
<f:render section="food" optional="true" />
If optional="true" is not set, then an exception will be thrown. This is the normal behavior so nothing should change for anyone unless they add the optional parameter.
History
Updated by Sebastian Kurfuerst about 3 years ago
- Status changed from New to Accepted
- Assignee set to Sebastian Kurfuerst
- Priority changed from Should have to Must have
Updated by Sebastian Kurfuerst almost 3 years ago
- Due date set to 2010-06-25
- Start date changed from 2010-01-08 to 2010-06-18
- % Done changed from 0 to 20
- Estimated time set to 2.00
need to write a selenium test for it.
Updated by Sebastian Kurfuerst about 2 years ago
- Tracker changed from Bug to Feature
- Target version set to 1.0 beta 1
Updated by Sebastian Kurfuerst almost 2 years ago
- Priority changed from Must have to Should have
- Target version changed from 1.0 beta 1 to 1.0 beta 2
- Has patch set to No
Updated by Robert Lemke over 1 year ago
- Target version changed from 1.0 beta 2 to 1.0.0
Updated by Karsten Dambekalns over 1 year ago
- Target version changed from 1.0.0 to 1.1 beta 1
Updated by Karsten Dambekalns over 1 year ago
- Target version changed from 1.1 beta 1 to 1.1
Updated by Florian Carstens about 1 year ago
Wouldn't it be better if there were the possibility to check that the section's content is not empty?
<f:if condition="{section.sidebar}">
<f:then>
<f:render section="sidebar" />
</f:then>
<f:else>
<p>I'm sorry, nothing here!</p>
</f:else>
Updated by Karsten Dambekalns about 1 year ago
- Target version deleted (
1.1)