[opencms-dev] check multiple content areas whether empty or not

Fabian Fabian18 at firemail.de
Thu Oct 30 14:20:02 CET 2003


Hi,

I have headlines for each content area.
If there is an content area without content only the headline is displayed.
This doesn't look pretty. Because of this I want to check whether an area is empty or not and only display the 
headlines and content if there is content.

Thats my contenttemplate:

<?xml version="1.0"?>
<XMLTEMPLATE>
  <TEMPLATE><![CDATA[
    <table width="100%" border="0">
      <tr>
        <td>
          <table border="0">
            <tr>
              <td width="1%">
                <font color="#C0C0C0"><i>Überschrift:</i></font>
              </td>
              <td>
                ]]><ELEMENT name="ueberschrift"/><![CDATA[
              </td>
            </tr>

            <tr>
              <td width="1%">
                <font color="#C0C0C0"><i>Autor:</i></font>
              </td>
              <td>
                ]]><ELEMENT name="autor"/><![CDATA[
              </td>
            </tr>

            <tr>
              <td width="1%">
                <font color="#C0C0C0"><i>Datum:</i></font>
              </td>
              <td>
                ]]><ELEMENT name="datum"/><![CDATA[
              </td>
            </tr>

            <tr>
              <td colspan="2"> </td>
            </tr>

            <tr>
              <td colspan="2">
                <font color="#C0C0C0"><i>Beschreibung:</i></font>
              </td>
            </tr>

            <tr>
              <td colspan="2">
                ]]><ELEMENT name="beschreibung"/><![CDATA[
              </td>
            </tr>

            <tr>
              <td colspan="2"> </td>
            </tr>

            <tr>
              <td colspan="2">
                <font color="#C0C0C0"><i>Text:</i></font>
              </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td>]]><ELEMENT name="body"/><![CDATA[</td>
      </tr>
    </table>
  ]]></TEMPLATE>

  <ELEMENTDEF name="ueberschrift">
      <CLASS>com.opencms.template.CmsXmlTemplate</CLASS>
      <TEMPLATESELECTOR>ueberschrift</TEMPLATESELECTOR>
  </ELEMENTDEF>
  <ELEMENTDEF name="autor">
      <CLASS>com.opencms.template.CmsXmlTemplate</CLASS>
      <TEMPLATESELECTOR>autor</TEMPLATESELECTOR>
  </ELEMENTDEF>
  <ELEMENTDEF name="datum">
      <CLASS>com.opencms.template.CmsXmlTemplate</CLASS>
      <TEMPLATESELECTOR>datum</TEMPLATESELECTOR>
  </ELEMENTDEF>
  <ELEMENTDEF name="beschreibung">
      <CLASS>com.opencms.template.CmsXmlTemplate</CLASS>
      <TEMPLATESELECTOR>beschreibung</TEMPLATESELECTOR>
  </ELEMENTDEF>
</XMLTEMPLATE>

_________________________________________________________________
www.ebay.de Hier Finden Sie Auktionen und Festpreisangebote!





More information about the opencms-dev mailing list