Dashboard > Castle Contrib > ... > Castle.MonoRail.ViewComponents > Faq List Component
Faq List Component
Added by James Curran, last edited by James Curran on Aug 27, 2007  (view change)
Labels: 
(None)


ViewComponent to build a list of Frequently Asked Questions. The generated markup displays the question, and using DHTML, displays & hides the answer when the question text is clicked.

public class FaqListComponent

Remarks

FaqItemComponent is one of two different components for creating FAQ pages.

It is intended to format FAQ entries where the text is comes from an external data source.
To format FAQ entries where the text in hard-coded in the view, see Faq Item Component.

FaqItem is a line component which has no subsections, one required and three optional parameters.

Parameter Description
Elements An IEnumerable collection of QnA objects, holding the text of the FAQs to display. (Required, no default)
QuestionCssClass CSS Class used for the DIV block holding the question. (Default: Question)
AnswerCssClass CSS Class used for the DIV block holding the answer. (Default: Answer)
ListType Indicates how the items should be formatted into alist. Must be one of values in the table below. (Default: None)
ListType Description
None Items are rendered without any form of list structure.
Ordered Items are numbered. ("OL" and "Numbered" are acceptable alternatives)
Unordered Items are bulleted. ("UL" and "bullet" are acceptable alternatives)

NOTE: This ViewComponent makes use of the prototype.js javascript library, and therefore requires the following line appears in either the view which FaqItemComponent is used, or the layout template used by that view: $AjaxHelper.GetJavascriptFunctions()

Copyright © 2007, James M. Curran
Licensed under the Apache License, Version 2.0

Example

#component (FaqListComponent with "Elements=$faqItems")

See Faq Item Component for example of markup generated.

Site running on a free Atlassian Confluence Community License granted to Castle Project. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators