Aller au contenu principal Aide Panneau de contrôle

A+   A-

Logiciel serveur «  

Documentation : _index.php

_index.php - Welcome in the world of YACS

Well, this script is the front page of a YACS server.

If you are looking for general information about YACS, including design principles, please look at help.php.

Usually the front page is the most often visited page of a web site. Therefore we have crafted it as carefully as possible, to allow for maximum flexibility and efficiency.

First of all, YACS offers powerful features to assign content to various areas of the front page. These areas (e.g., cover page, gadget boxes, etc.) are introduced below.

Second, YACS offers a large number of customization options, and most parameters that impact the front page can be conveniently changed at the related configuration panel. Look at configure.php for a full description of these parameters. This configuration panel is accessible from the Control Panel.

Also, several extension mechanisms have been added to this page, and we hope that gifted software programmers will take the most out of it. Look at control/scan.php for more information on YACS hooks and software extensions.

And of course, most tags generated by YACS, if not all, make intensive usage of CSS. Therefore the visual rendering can be changed directly by editing the style sheet used in the live skin for the site. Look at scripts/index.php for more information on skins and templates used by YACS.

General structure of a YACS page

Generally speaking the overall YACS rendering engine handles three different kinds of areas on the screen:
  • the main panel - This is where most of the text will be placed.
Every YACS script is aiming to put some content in the main area.
  • the extra panel - Extra information, if any, to be displayed on page side.
YACS scripts make intensive use of this to further improve site navigation.
  • the navigation panel - This is common information to be displayed on all pages.
Most content of the navigation panel is generated and managed only in the template file of the current skin. However, some script, such as the one that generates the front page, may complement the navigation panel with additional information specific to only one page.

Please note that some skins do combine the extra and the navigation panels as a single visual column, where other skins will feature three column, or two columns plus a floating container, etc.

The main panel

Several elements compose the main part of this page. From first to last:
  • Top icons
  • The cover article
  • Text produced by hooks included on id 'index.php#prefix'
  • A dynamic Flash object listing most recent articles
  • Gadgets boxes
  • A list of sections. Several layouts are available?
  • Text produced by hooks included on id 'index.php'
  • The list of most recent articles. Several layouts are available, as explained below.
  • The list of most recent files
  • The list of most recent links
  • Bottom icons
  • Text produced by hooks included on id 'index.php#suffix'


The cover article is, actually, posted in the section dedicated to global pages. This section is visible from the Site Map. To change the cover page edit it, like you would do for any regular article. You can add images, use various YACS code or any HTML tag to achieve your goal. On completion, publish the article to make it visible at the front page. Rendering of the cover page may be total or partial based on parameter root_cover_at_home. Content of the cover article is formatted through a call to Skin::layout_cover_article(). Though this function has been implemented into skins/skin_skeleton.php, it can be overloaded into skin.php of any skin if necessary.

The prefix hook is used to invoke any software extension bound as follows:
  • id: 'index.php#prefix'
  • type: 'include'
  • parameters: none
Use this hook to include any text right after the cover article.

The Flash object is a convenient way to dynamically animate the front page, based on most recent articles published. This has to be explicitly activated in the parameter root_flash_at_home.

Gadget boxes are used either to display information that is not part of the regular stream of new content, or to specifically focus on special pages. Change parameter root_gadget_boxes_at_home to disable the display of gadget boxes. Up to 6 gadget boxes can be displayed at the front page.
  • The most straightforward way to create gadget boxes is to post articles
in the section dedicated to gadget boxes. Each article will be put in a separate box.
  • Moreover, categories can also be configured to list their content in
gadget boxes. In this case each category will have its own box, and up to 5 pages and 5 links will be listed per box.
  • Configure some sections to list their content in gadget boxes. You can
select to have either one box per section, with up to 7 pages or links will be listed per box, or to have every article in its own separate box.

Activate the display of the Site Map (actually, a downsize version of it) to introduce top-level sections of your site. The layout used by YACS is specified in parameter sections_layout.

The main hook is used to invoke any software extension bound as follows:
  • id: 'index.php'
  • type: 'include'
  • parameters: none
Use this hook to include any text just before the list of recent publications.

By default, articles are formatted through a call to Skin::build_list(... 'decorated'). This function can be overloaded into skin.php of any skin. The configuration panel for the front page (aka, configure.php) may be used to adopt another layout depending of your needs. The parameter root_articles_layout defines the layout to be used at the front page:
  • daily - Make titles out of publication dates.
This layout is suitable for weblogs. It is the default value. See skins/layout_home_articles_as_daily.php
  • newspaper - Focus on the last published article, and list some articles published previously.
This layout is suitable for most sites. See skins/layout_home_articles_as_newspaper.php
  • boxesandarrows - List the last ten most recent pages.
Previous articles may be accessed through sections, or through the index of articles. This layout is suitable for sites providing several different kinds of information. See skins/layout_home_articles_as_boxesandarrows.php
  • slashdot - List the last ten most recent pages.
Previous articles may be accessed through sections, or through the index of articles. This layout is suitable for sites providing several different kinds of information. See skins/layout_home_articles_as_slashdot.php
  • decorated - A compact list of the ten most recent articles.
This layout is suitable for sites with a lot of items (gadget boxes, etc.) at the front page. See articles/layout_articles.php
  • compact - A simple list of titles.
  • alistapart - Display only the most recent published page.
Previous articles may be accessed through a menu. This layout is suitable for small sites with a low activity, maybe with a single section of pages.
  • no_articles - Do not mention recent articles.
Use this option to fully customize the front page, for example through some hook.

The number of articles displayed depends on the selected layout. For example, the alistapart layout displays one single full-page, while slashdot summarizes several articles. To override this number set the parameter root_articles_count_at_home in the configuration panel for rendering engine.

This front page is also able to display the content of one single section, if its id is specified in the parameter root_sections_at_home. In this case, the list of recent pages may be affected by any overlay that has been activated for the target section. For example, if a section has been overlaid with day, and if its id has been set in root_sections_at_home, then a pretty calendar of coming events will be displayed at the front page.

The list of most recent public files can be added as well, by changing explicitly parameter home_with_recent_files.

The list of most recent public links can be added as well, by changing explicitly parameter home_with_recent_links.

Bottom and trailing icons are clickable images linked to related articles. For example, you would use this to show logos of your partners at the front page, and create one page to introduce each partner. To achieve this, add thumbnails to target pages, then configure the containing section to display them at the front page. Up to 12 images are displayed.

The suffix hook is used to invoke any software extension bound as follows:
  • id: 'index.php#suffix'
  • type: 'include'
  • parameters: none
Use this hook to include any text at the bottom of the main area, after everything else.

The extra panel

Following components are displayed as boxes in the extra panel:
  • The list of featured articles, if any
  • News
  • Articles featured as extra boxes (one box per article) -- see the 'extra_boxes' section
  • Sections featured as extra boxes (one box per section), if any
  • Categories configured to appear here, if any - one box per category, with a list of related articles
  • A list of older pages


Featured pages are those articles that have been assigned to the category dedicated to that purpose. To feature one particular article, display it, then use side links to change assigned categories. Select the category named Featured in the drop list and click on the button.

The navigation panel

Following items are put in the navigation panel:

Customized templates

You may create a specific template for this page to depart from regular rendering if you wish.

YACS looks for specific templates for this page into the skin directory, and it loads:
  • template_home.php for the regular front page of the server,
  • or template_slash.php for the topmost page


For example, when the server is installed in directory /yacs/ the template template_home.php is loaded on url /yacs/index.php, where the template template_slash.php is loaded on url /index.php.

When YACS is directly installed at the top level of the server (e.g., when the parameter 'url_to_root' is '/'), only the template template_home.php is used.

Meta information

A feeding link has been included, in order to let robots browse this resource when necessary. See feeds/rss_2.0.php for more information.

Simlarly, a meta-link to our blogging API is added, to allow for easy auto-discovery of server capability. See services/describe.php for more information.

If geographical information has been set in skins/configure.php, it is included in meta data. See either GeoTags Search Engine and Free Geocoding Service for 22 Countries for more information.

Note that, contrary to other regular pages, this one does not trigger the 'tick' hook.

This script is a reference file of this system.

Voir aussi :

Licence : GNU Lesser General Public License

Auteurs :

Testeurs :

  • Cloubech
  • Pat
  • Olivier
  • Agnes
  • Guillaume Perez
  • Viviane Zaniroli
  • Anatoly
  • Timster
  • Mordread Wallas
  • ThierryP

Reste à faire

  • add fame.php to list most popular items (NickR)
  • calendar view of articles (agnes)


tn