Members

Note: You can use your Sitellite.org account here and vice versa.

Username

Password

Remember Login

Forgot your password?

Not a member? Click here to register

Body Parts

Home Page | All Pages | Recently Revised | Authors | Feeds |

Sitellite allows you to access pieces of the page body, instead of the whole thing, for the purposes of displaying it in multiple columns, with a pager (ie. the 'previous|next' links), or in other complex layout scenarios. This is done via the body_parts array in XT. The pieces of the body are split by horizontal rule tags. Note that you can always access the original page body inclusive of horizontal rules if you don't need your page body split up.

Example Usage:

<xt:condition>
<xt:if expr="php: count (object.body_parts) le 1">
    <!-- there is only one part -->
    <xt:var name="body" />
</xt:if>
<xt:else>
    <!-- split into two columns -->
    <table border="0" width="100%">
        <tr>
            <td width="50%" style="padding: 3px; padding-right: 15px">
                <xt:var name="body_parts/0" />
            </td>
            <td width="50%" style="padding: 3px">
                <xt:var name="body_parts/1" />
            </td>
        </tr>
    </table>
</xt:else>
</xt:condition>

Note: The expression was changed from "eq 1" to "le 1" for less-than-or-equal-to 1 so that action or form pages that don't get the splitting feature that ordinary pages do, will still render themselves.

Revised on July 24, 2006 10:42 AM by admin

Back in time (2 more) | Linked from: Templates