[docs] docs - jon modified 2 files
docs@interchange.redhat.com
docs@interchange.redhat.com
Fri Dec 28 11:54:01 2001
User: jon
Date: 2001-12-28 16:53:34 GMT
Modified: . ictags.sdf ictemplates.sdf
Log:
Document the [loop option="..."] attribute in ictags, complementary to the
existing info in ictemplates.
Revision Changes Path
1.70 +59 -2 docs/ictags.sdf
rev 1.70, prev_rev 1.69
Index: ictags.sdf
===================================================================
RCS file: /var/cvs/docs/ictags.sdf,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -u -r1.69 -r1.70
--- ictags.sdf 2001/12/21 01:57:45 1.69
+++ ictags.sdf 2001/12/28 16:53:34 1.70
@@ -1,10 +1,10 @@
!init OPT_LOOK="akopia"; OPT_STYLE="manual"
-# $Id: ictags.sdf,v 1.69 2001/12/21 01:57:45 danb Exp $
+# $Id: ictags.sdf,v 1.70 2001/12/28 16:53:34 jon Exp $
!define DOC_NAME "Interchange Tags Reference"
!define DOC_TYPE ""
!define DOC_CODE "ictags"
-!define DOC_VERSION substr('$Revision: 1.69 $', 11, -2)
+!define DOC_VERSION substr('$Revision: 1.70 $', 11, -2)
!define DOC_STATUS "Draft"
!define DOC_PROJECT "Interchange"
!define DOC_URL "http://interchange.redhat.com/doc/ictags.html"
@@ -8094,6 +8094,63 @@
> [on-match]</SELECT>[/on-match]
> [/loop]
+A nice shortcut is available when using [loop] to generate <OPTION>
+lists inside HTML <SELECT>...</SELECT> blocks, when you want the user's
+last selection to be chosen by default on subsequent page views. Interchange
+simplifies this with functions that output "SELECTED" (surrounded by
+appropriate whitespace) for an <OPTION> if a certain value is set to
+the <OPTION VALUE="...">. (It sounds more complicated than it really is.)
+
+For example, consider:
+
+!block example
+<select name=search_cat>
+[loop
+ search="
+ fi=cat
+ st=db
+ ra=yes
+ rf=name
+ tf=name
+ un=1
+ "
+]
+<option[selected search_cat [loop-code]>[loop-code]
+[/loop]
+</select>
+!endblock
+
+When the user returns to the page, their last selection will be chosen
+as the default. (Assuming the value search_cat was set after the search,
+which is normally is with standard searches.)
+
+\[loop] offers the C<option> attribute, which can give loops that parse
+faster and are easier to write. The following example is equivalent to
+the one above:
+
+!block example
+<select name=search_cat>
+[loop
+ option=search_cat
+ search="
+ fi=cat
+ st=db
+ ra=yes
+ rf=name
+ tf=name
+ un=1
+ "
+]
+<option>[loop-code]
+[/loop]
+</select>
+!endblock
+
+It works equally well when option values are explicitly specified:
+
+><option value="[loop-code]">So-called "[loop-code]"
+
+See also the C<ictemplates> documentation in the section "Checks and Selections."
H4: E<lbracket>if-loop-data table column] IF [else] ELSE [/else][/if-loop-field]
1.29 +4 -2 docs/ictemplates.sdf
rev 1.29, prev_rev 1.28
Index: ictemplates.sdf
===================================================================
RCS file: /var/cvs/docs/ictemplates.sdf,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -u -r1.28 -r1.29
--- ictemplates.sdf 2001/12/06 03:27:27 1.28
+++ ictemplates.sdf 2001/12/28 16:53:34 1.29
@@ -1,10 +1,10 @@
!init OPT_LOOK="akopia"; OPT_STYLE="manual"
-# $Id: ictemplates.sdf,v 1.28 2001/12/06 03:27:27 jon Exp $
+# $Id: ictemplates.sdf,v 1.29 2001/12/28 16:53:34 jon Exp $
!define DOC_NAME "Template Guide"
!define DOC_TYPE ""
!define DOC_CODE "ictemplates"
-!define DOC_VERSION substr('$Revision: 1.28 $',11, -2)
+!define DOC_VERSION substr('$Revision: 1.29 $',11, -2)
!define DOC_STATUS "Draft"
!define DOC_PROJECT "Interchange"
!define DOC_URL "http://interchange.redhat.com/doc/ictemplates.html"
@@ -2609,6 +2609,8 @@
[/loop]
</SELECT>
!endblock
+
+See also the C<ictags> documentation on the [loop] tag.
H2: Integrated Image Maps