My first post, I apologise if this has been answered - I have looked but I cannot find an answer.

I have created a page--front.tpl.php file and in it a PHP include directive to my front page contents file (contents.php). That works fine, but when a new article or page is added the teaser is posted on top of my content on the front page.

Deselecting the publishing options "Published" and "Promoted to front page" on the individual new items does not prevent this, nor does deselecting these options in Structure | Content types.

I have also tried creating a front page node with path "home" and adding that to Configuration | Site information. Again this works until I create new content.

I must be missing something!

Thanks, Bill

Comments

nevets’s picture

What is in contents.php?

canadensis’s picture

Thanks nevets,

.../sites/default/files/content/front_page_content.php contains HTML only.

The only change to /themes/bartik/templates/page--front.tpl.php is the addition of the <?php include, the second last line in the section of the file reproduced here. The ... is the absolute path to what is reproduced here.

    <div id="content" class="column"><div class="section">
      <?php if ($page['highlighted']): ?><div id="highlighted"><?php print render($page['highlighted']); ?></div><?php endif; ?>
      <a id="main-content"></a>
      <?php print render($title_prefix); ?>
      <?php if ($title): ?>
        <h1 class="title" id="page-title">
          <?php print $title; ?>
        </h1>
      <?php endif; ?>
      <?php print render($title_suffix); ?>
      <?php if ($tabs): ?>
        <div class="tabs">
          <?php print render($tabs); ?>
        </div>
      <?php endif; ?>
      <?php print render($page['help']); ?>
      <?php if ($action_links): ?>
        <ul class="action-links">
          <?php print render($action_links); ?>
        </ul>
      <?php endif; ?>
      <?php include(".../sites/default/files/content/front_page_content.php"); ?>
      <?php print $feed_icons; ?>

    </div></div> <!-- /.section, /#content -->

Thanks for your help,
Bill

nevets’s picture

Why not use a more drupal approach, create a node with the front page information and make that the default front page (under configuration >> site information)

canadensis’s picture

Thanks again for your help, I will do this in a more "Drupal way". I have it working now:

Create a basic page, address is node/1 (for example).
Go to Configuration | System | Site information and set the Default front page to node/1.