Child pages
  • Development-Examples-Page Layout

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Here is a trivial example of a page layout WOComponentContent:

Code Block
{panel}
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  <html>
    <head>
         <title>
        <webobject name = "Title"></webobject>
      </title>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
      <webobject name = "Stylesheet"></webobject>
    </head>
  
    <webobject name = "Body">
      <webobject name = "Form">
        <webobject name = "Table">
          <tr>
            <td align = "left" valign = "top" colspan = "3">
              <webobject name = "Header"></webobject>
            </td>
          </tr>
          <tr>
            <td align = "left" valign = "top" colspan = "3">
              &nbsp; 
            </td>
          </tr>
          <tr>
            <td align = "left" valign = "top" class = "Margin">
              &nbsp; 
            </td>
            <td align = "left" valign = "top">
              <webobject name = "Content"></webobject>
            </td>
            <td align = "left" valign = "top" class = "Margin">
              &nbsp; 
            </td>
          </tr>
          <tr>
            <td align = "left" valign = "top" colspan = "3">
              &nbsp; 
            </td>
          </tr>
          <tr>
            <td align = "left" valign = "top" colspan = "3">
              <webobject name = "Footer"></webobject>
            </td>
          </tr>
        </webobject>
      </webobject>
    </webobject>
  </html>
{panel}
Panel

And the wod:

Panel
Wiki Markup
Code Block

Title: WOString
 
{
   
value = title;
 
};
 
 
Stylesheet: Stylesheet
 
{
 
};
 
 
Body: WOBody
 
{
 
};
 
 
Table: WOGenericContainer
 
{
   
elementName = "table";
   
border = "0";
   
cellSpacing = "0";
   
cellPadding = "0";
   
class = "FullWidth";
 
};
 
 
Form: WOForm
 
{
   
multipleSubmit = true;
 
};
 
 
Header: Header
 
{
   
title = ^title;
   
page = ^page;
   
pathComponents = ^pathComponents;
 
};
 
 
Footer: Footer
 
{
 
};
 
 
Content: WOComponentContent
 
{
 
};

To use this layout, you could do the following in one of your pages:

Panel
Code Block
{panel}   <webobject name = "PageLayout">
    <webobject name = "Table">
      <tr>
        <td align = "left" valign = "top">
          <webobject name = "Envelopes"></webobject>&nbsp; 
        </td>
        <td align = "left" valign = "top" class = "Margin">
          &nbsp; 
        </td>
        <td align = "left" valign = "top" class = "FixColumn">
          <webobject name = "Table">
            <tr>
              <td align = "left" valign = "top">
                <webobject name = "ThreadList"></webobject>
              </td>
            </tr>
            <tr>
              <td align = "left" valign = "top">
                <webobject name = "DocumentList"></webobject>
              </td>
            </tr>
            <tr>
              <td align = "left" valign = "top">
                <webobject name = "LinkList"></webobject>
              </td>
            </tr>
            <tr>
              <td align = "left" valign = "top">
                <webobject name = "RelatedList"></webobject>
              </td>
            </tr>
          </webobject>
        </td>
      </tr>
    </webobject>
  </webobject>
{panel}

wod file:

Panel
Wiki Markup
Code Block

PageLayout: PageLayout
 
{
   
title = title;
   
page = name;
   
pathComponents = pathComponents;
 
};
 
 
Name: SpanString
 
{
   
value = value;
   
isBig = true;
   
isBold = true;
 
};
 
 
Table: WOGenericContainer
 
{
   
elementName = "table";
   
border = "0";
   
cellSpacing = "0";
   
cellPadding = "0";
   
class = "FullWidth";
 
};
 
 
Envelopes: Table
 
{
   
list = envelopes;
   
keysDescription = "self|recipientNames.iterator.next|sentDate";
   
headersDescription = "Subject|Recipient|Date";
 
};
 
 
ThreadList: List
 
{
   
title = "Thread";
   
list = threads;
   
minimumSize = 0;
   
//maximumSize = 20;
 
};
 
 
DocumentList: List
 
{
   
title = "Attachment";
   
list = documents;
   
minimumSize = 0;
   
//maximumSize = 20;
 
};
 
 
LinkList: List
 
{
   
title = "Link";
   
list = links;
   
minimumSize = 0;
   
//maximumSize = 20;
 
};
 
 
ListList: List
 
{
   
title = "List";
   
list = lists;
   
minimumSize = 0;
 
};
 
 
RelatedList: List
 
{
   
title = "Other";
   
list = value.relatedNames;
   
minimumSize = 0;
 
};

Category:WebObjects