You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@znep.com> on 1997/02/09 06:11:35 UTC

[PATCH][DOCS] add example of conditionals in mod_include

Doing something like the below is non-intuitive because of the quoting.  I
think the below example would be good.  If you can make a better one, do
it; otherwise I'll apply this.


Index: mod_include.html
===================================================================
RCS file: /export/home/cvs/apache/htdocs/manual/mod/mod_include.html,v
retrieving revision 1.5
diff -c -r1.5 mod_include.html
*** mod_include.html	1996/12/09 04:09:19	1.5
--- mod_include.html	1997/02/09 05:09:05
***************
*** 261,266 ****
--- 261,279 ----
      &lt;!--#if expr="$a = \$test" --&gt;
  </PRE>
  
+ <P> EXAMPLE: the below example will print "in foo" if the DOCUMENT_URI is 
+ /foo/file.html, "in bar" if it is /bar/file.html and "in neither" 
+ otherwise:
+ <PRE>
+     &lt;!--#if expr="\"$DOCUMENT_URI\" = \"/foo/file.html\""--&gt;
+     in foo
+     &lt;!--#elif expr="\"$DOCUMENT_URI\" = \"/bar/file.html\""--&gt;
+     in bar
+     &lt;!--#else --&gt;
+     in neither
+     &lt;!--#endif --&gt;
+ </PRE>
+ 
  
  <hr>
  <h2>Directives</h2>