Open Source Content Management Framework

MidCOM template style elements

Here is an example of how the elements can be used in the ROOT element. This example follows the OSCOM XHTML formatting Guidelines, and can be easily used with most layouts as-is, with the actual formatting rules going as CSS to files in the filesystem.

<?php
echo "<?xml version=\"1.0\"?>\n";

// Get the content language
$language = $_MIDCOM->i18n->get_content_language();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="&(language:h);" lang="&(language:h);">
  <head>
    <title>Site Example | <(page-title)></title>
    <!-- Insert stylesheets and JavaScript files here as example below shows -->
    <link rel="stylesheet" href="/css/style.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="/css/content.css" type="text/css" media="all" />
    <link rel="stylesheet" href="/css/print.css" type="text/css" media="print" />
    <link rel="stylesheet" href="<?php echo MIDCOM_STATIC_URL; ?>midcom.helper.datamanager2/legacy.css" />
    <?php
    // Print MidCOM head elements (e.g. component stylesheets and JavaScript files)
    $_MIDCOM->print_head_elements();
    ?>
  </head>
  <body class="<?php echo $_MIDCOM->metadata->get_page_class(); ?>" <?php $_MIDCOM->print_jsonload(); ?>>
    <?php
    // Show the toolbar
    $_MIDCOM->toolbars->show();
    ?>
    <div id="container">
      <div id="branding">
        <div class="grouplogo">
          <!-- Insert logo here -->
        </div>
        <div id="branding-tagline">
        </div>
        <div id="branding-trail">
          <?php
          $nap = new midcom_helper_nav();
          echo $nap->get_breadcrumb_line();
          ?>
        </div>
      </div>
      <div id="nav">
        <div id="nav-main">
          <?php
          // Load the navigation component
          $_MIDCOM->componentloader->load('fi.protie.navigation');

          // Initialize navigation class
          $navigation = new fi_protie_navigation();

          // Draw the navigation
          $navigation->draw();
          ?>
        </div>
        <div id="nav-language">
         <!-- Language switching links -->
        </div>
        <div id="search">
          <div class="search-input">
          </div>
        </div>
      </div>
      <div id="content">
        <div id="content-main">
          <(content)>
        </div>
      </div>
      <?php
      // Show UI messages
      $_MIDCOM->uimessages->show();
      ?>
      <div id="siteinfo">
        <div id="siteinfo-credits">
          Created by <a href="http://www.nemein.com/">Nemein Oy</a>.
          Powered by <a href="http://www.midgard-project.org/">Midgard CMS</a>.
        </div>
        <div class="siteinfo-legal">
         <!-- Copyright disclaimer and possible licensing -->
        </div>
        <div id="feedback">
            <!-- link to feedback -->
        </div>
      </div>
    </div>
  </body>
</html>
Tagged
style element
building
midcom
site
Designed by Nemein, hosted by Anykey