Home « Server software «
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 configuration panel for the rendering engine. Look at skins/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.
- the extra panel - Extra information, if any, to be displayed on page side.
- the navigation panel - This is common information to be displayed on all pages.
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 subset of the Site Map
- 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, the most recent article published in the section dedicated to covers. This section is visible to associates at the bottom of the Site Map. To create a new cover article, just add an article to this section. 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
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 template if necessary.The prefix hook is used to invoke any software extension bound as follows:
- id: 'index.php#prefix'
- type: 'include'
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
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
gadget_boxes_at_home to disable the display of gadget boxes.
Up to 6 gadget boxes can be displayed at the front page.
There are different ways to create gadget boxes:
- Activate one box to list collections of shared files, through parameter
collections_at_home. - Post articles in the section dedicated to gadget boxes.
- Configure some categories to be displayed as gadget boxes.
- Configure some sections to list their content in gadget boxes.
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_at_home.
This can be:
- 'map1' - Top-level public sections are stacked.
- 'map2' - Top-level public sections are displayed in a two-column layout, similar to the one featured on Yahoo! front page.
- integer value - This is used as the id of the section to focus on. Content of the specified section is based on layout 'decorated'.
- 'none' - Surfers will have to visit the plain Site Map
The main hook is used to invoke any software extension bound as follows:
- id: 'index.php'
- type: 'include'
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 skins (aka, skins/configure.php) may be used
to adopt another layout depending of your needs.
The parameter home_layout defines the layout to be used at the front page:
daily- Make titles out of publication dates.
newspaper- Focus on the last published article, and list some articles published previously.
boxesandarrows- List the last ten most recent pages.
slashdot- List the last ten most recent pages.
decorated- A compact list of the ten most recent articles.
compact- A simple list of titles.alistapart- Display only the most recent published page.
no_articles- Do not mention recent articles.
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
articles_count_at_home in the configuration panel for rendering engine.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'
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, if configured in skins/configure.php
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:- The list of most popular pages, if configured in skins/configure.php
- The list of most popular files, if configured in skins/configure.php
- The list of most popular links, if configured in skins/configure.php
- A list of articles selected randomly, if configured in skins/configure.php
Also, 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.
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 features several levels of cache. On ideal case, it can be rendered on one single SQL statement.
This script is a reference file of this system.
Voir aussi:
Licence: GNU Lesser General Public License
Auteurs:
- Bernard Paques bernard.paques@bigfoot.com
Testeurs:
- Cloubech
- Pat
- Olivier
- Agnes
- Guillaume Perez
- Viviane Zaniroli
- Anatoly
- Timster
- Mordread Wallas
Reste à faire:
- add fame.php to list most popular items (NickR)
- calendar view of articles (agnes)