The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>
      WebMake: Documentation: ${content_refs} - References to Content Chunks
    </title>
    <meta name="generator" content="WebMake/2.2" />
    <style>
      body {
       background-color: #ffffff; 
       color: #000000; 
       font-size: medium;
       font-family: verdana,lucida,helvetica,sans-serif;
      }
      code, samp, pre {
       font-family: Courier New,courier,fixed-width,monospace;
      }
      H1 { font-size: x-large; font-family: Garamond,Book Antiqua,Times,serif; background: #FFCC66; }
      H2 { font-size: large; font-family: Garamond,Book Antiqua,Times,serif; background: #FFDD77; }
      H3 { font-size: medium; font-family: Garamond,Book Antiqua,Times,serif; background: #FFEE88; }
      H4 { font-size: small; font-family: Garamond,Book Antiqua,Times,serif; }
      H5 { font-size: x-small; font-family: Garamond,Book Antiqua,Times,serif; }
      H6 { font-size: xx-small; font-family: Garamond,Book Antiqua,Times,serif; }
      A:link {
       font-weight: bold;
       color: #004000;
       text-decoration: underline; 
      }
      A:visited {
       font-weight: normal;
       color: #008000;
       text-decoration: underline; 
      }
      A:active {
       font-weight: bold;
       color: #800000;
       text-decoration: underline; 
      }
      dt {
       font-size: medium;
       font-weight: bold;
       padding-top: 8px; padding-bottom: 8px;
      }
      dd {
       padding-top: 8px; padding-bottom: 8px;
      }
    </style>
  </head>
  <body bgcolor="#ffffff" text="#000000" link="#3300cc" vlink="#660066">
    <font face="lucida,verdana,sans-serif">
      <div align="center">
        <img src="images/WebMakeTitle.png" alt="WebMake" width="500" height="122" />
      </div>
      <table width="100%">
        <tr>
          <td valign="top">
            <strong><a href="http://webmake.taint.org/">WebMake</a>
             Documentation</strong> (version 2.2)
             
          </td>
          <td valign="top">
            <div align="right">
              
               [ <a href="index_04-var_refs.html">Back</a> | <a href="url_refs.html">Forward</a> | <a href="index.html">Index</a>
               | <a href="allinone.html">All&nbsp;In&nbsp;One</a> ]
               
            </div>
          </td>
        </tr>
      </table>
<!-- yes, it's that Mozilla black-border code again ;) -->
      <!-- stolen from www.mozilla.org via rc3.org -->
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <td bgcolor="#aaaaaa">
            <table border="0" cellspacing="4" cellpadding="4" width="100%">
              <tr>
                <td bgcolor="#ffffff">
                  <table border="0" cellspacing="4" cellpadding="4" width="100%">
                    <tr>
                      <td>
                        <h1>${content_refs} - References to Content Chunks</h1><p>
                          Content chunks and variables can be referred to using this format. This is
                          evaluated before any other variable reference is.
                          
                        </p>
                        <blockquote>
                          <p>
                            <strong>${<em>name</em>}</strong>
                          </p>
                        </blockquote>
                        <p>
                          Content chunks can refer to other chunks, URLs, or use deferred references,
                          up to 30 levels deep.
                          
                        </p>
                        <a name="Default_Values"><h3>Default Values</h3></a><p>
                          If you wish to refer to a content item or variable, but are not sure if it
                          exists, you can provide a default value by following the content name
                          with a question mark and the default value.
                          
                        </p>
                        <blockquote>
                          <p>
                            <strong>${<em>name</em>?<em>defaultvalue</em>}</strong>
                          </p>
                        </blockquote>
                        <a name="Parameterized_References"><h3>Parameterized References</h3></a><p>
                          Content references can also be <em>parameterised</em> references; this means
                          that they act like function calls, in a way, allowing you to pass
                          in parameters. They look like this:
                          
                        </p>
                        <blockquote>
                          <p>
                            <strong>${<em>name</em>: <em>parameter</em>="<em>value</em>" ...}</strong>
                          </p>
                        </blockquote>
                        <p>
                          The parameters are declared in the XML style.
                          
                        </p>
                        <blockquote>
                          <p>
                            <strong>Note:</strong> the parameters' values must not contain further content
                             references, due to a limitation in the way WebMake parses
                             content refs. If you want to refer to a content item from
                             within a template, pass in the <strong>name</strong> of the content item,
                             and get the template to expand it; see the example below.
                            
                          </p>
                        </blockquote>
                        <p>
                          For example, if you set up a template item like this:
                          
                        </p>
                        <p>
                          <!--etsafe-->
                          <pre>

	&lt;template name="mytemplate"&gt;
		You passed in &#36;{name}, and its value is \"&#36;{&#36;{name}}\".
	&lt;/template&gt;
                        </pre>
<!--/etsafe-->
                                              </p>
                      <p>
                        and a content item like this:
                        
                      </p>
                      <p>
                        <!--etsafe-->
                        <pre>

	&lt;content name="foo"&gt;
		Hi, I'm foo!
	&lt;/content&gt;
                      </pre>
<!--/etsafe-->
                                          </p>
                    <p>
                      Then a reference to:
                      
                    </p>
                    <blockquote>
                      <p>
                        <strong>${mytemplate: name="foo"}</strong>
                      </p>
                    </blockquote>
                    <p>
                      will expand to:
                      
                    </p>
                    <blockquote>
                      <p>
                        **You passed in foo, and its value is \"Hi, I'm foo!\".
                        
                      </p>
                    </blockquote>
                    <p>
                      
                    </p>
                  </p>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table width="100%">
  <tr>
    <td valign="top">
      <strong><a href="http://webmake.taint.org/">WebMake</a>
       Documentation</strong> (version 2.2)
       
    </td>
    <td valign="top">
      <div align="right">
        
         [ <a href="index_04-var_refs.html">Back</a> | <a href="url_refs.html">Forward</a> | <a href="index.html">Index</a>
         | <a href="allinone.html">All&nbsp;In&nbsp;One</a> ]
         
      </div>
    </td>
  </tr>
</table>
<div align="right">
  <a href="http://webmake.taint.org/"><img src="images/BuiltWithWebMake.png" alt="Built With WebMake" border="0" width="88" height="31" /></a>
</div>
</font>
</body>
</html>