[4.0] Announcement only on startpage
Written by Arthur Konze   
Friday, 16 May 2003

Normaly Mambo displays Announcement's on every page of your website. That's fine for some people, but most of the webmasters want their announcement only shown on the startpage or specific page. Mambo currently (4.0.13) lets you no choice on which page to display the announcement so you have to use a template trick to show it only on the startpage.

Open your templatename.php in the themes folder and search for the includement of the announcement. It should look like this:

<?php
  
include ("newsflash.php");
?>

To make it visible only on the startpage we have to check, if we are on the startpage or not. To do so you must know that Mambo handles all pages with the "option" variable, except for one page... the startpage. So we just check if the "option" variable is empty and if so we are on the startpage where we display the announcement. We replace the above code with the following:

<?php
  if ($option=="") {
    include ("newsflash.php");
  }
?>

If you want to see your announcement not on the startpage but on a specific content page, just put the option name of the page into the brackets of the if clause. For example "com_minibb" will make the announcement only show on the forum page.