Step Two --- Installing blocks

Overview

Your site doesn't yet have any forums, news or even welcome messages. To welcome your friends, you will first add a message to the top page. Then you'll install modules for your plan ---- a baseball forum & news about Oregonian baseball players. In this section, you will learn how to build the home page by using blocks.

The basic layout of homepage

The following picture shows the basic layout of the home page in XOOPS Cube Legacy.

xoopscube.org uses the block layout, too. It uses left, center and right blocks. That's the standard XOOPS layout.

The layout in most themes uses three columns;the left column, the center column and the right column. Plus, the upper part of the center column has two more columns;the left-center column and the right-center column. You can assign blocks to these columns.

A block is a part or piece containing dynamic content. Blocks belong to modules and are installed together with their modules. You already have three blocks which were installed by default. You also have a lot of other blocks that came with the system and that you can install as you wish.

Login Block

The block you use to login is the "Login Block". This block is installed by default. This block displays text boxes for user's name and password. Once you have logged in, the login block is no longer visible. In other words, a block can be set to display or not, depending on the permissions of the user.

Main Menu Block

This is the standard automatic main menu block for all users. The main menu block has a link to the home page and also shows a list of all the modules which the current user has been allowed access to.

User Menu Block

This is a personal menu for registered users. It shows links to the user's profile and other pesonal settings.

Step Two (1) --- How to install new blocks
Block Installation

First of all you will install the "Site Info" block in the right column of your home page. This block shows your visitors the username and address of your administrators. Go to the control menus on the left hand side of the Control Panel and click Block Installation in the Legacy System control menu.

You will see the list of unused blocks.

Find the row with the "Site Info" block and click the install icon of that row.

Block Installation

The "Site Info" block hasn't been installed yet. You have to input some settings for it.

Title

This is the title of the block that your visitors will see. You don't need to change it this time, if you don't wish to.

Side

Specify which column you want to assign the block to. This time, specify "Side block - right".

Order

This sets the order of the block in the column. When you have several blocks all in the same column, they will be ordered from the top down, according to their order setting. You can leave this as the default for now, we'll have a look at this shortly.

Cache time

You can specify how long the system keeps the block in cache. When the cache is active, the system will use the cache file when it can. This setting can be a little difficult, leave it for now.

Target modules

Here you specify in which modules you wish to have the block displayed. This time, specify "Top page" only.

Target groups

Here you specify which groups you give permission to view the block. What's a group? A group is a collection of users. Each group has permissions that allow it to access different parts of the site, such as modules or the administration control panel. You already have three system-fixed groups. These groups are special, so the administrator can't delete them.

Webmasters
This is the top group of this site. Users in this group are allowed to perform any action. The administrator you used to login belongs to this group.
Registered Users
Common users who registered through the user registration system, belong to this group by default.
Anonymous Users
This group is unregistered users, the general public.

In this case you don't need to hide this block from any user so specify all three groups.

Options

When the block has optional settings, this item is shown. You don't need to change any fields this time.

Install

After you finish settings, click the install button! Then go to your site's homepage to view the block.

Step Two (2) --- How to control the order of blocks

Since this concerns the ordering of blocks on a page, you have to install one more block before we can see the effect. Let's install the "Search" block so that users can search your site. When you install the block, choose "Side block - right" and "all modules" for the target modules. Now you have two blocks that have been placed in the right column. The "Search" block shows up in all pages, whereas the "Site Info" block is visible only in the top page.

Next, set the order of these blocks. In the control menu section on the left-hand side of the Control Panel, click Block Management in the Legacy System control menu.

You see the list of installed blocks.

Input 1 for the order of the "Search" block and input 5 for the order of the "Site Info" block.

Then click the "Submit" button. Now the "Search" block will always be displayed before the "Site Info" block.

Step Two (3) --- How to use custom blocks

Now, let's add the "welcome message" to the top page of your site. All you have to do is add a block of course but all of the blocks that we have here already seem to have specific functionality. All you really want is to be able to display your message. This is where custom blocks come into play.

First of all, go to Block Management. Then click "Add custom block" at the top of the table.

You will be presented with a basic edit-form to create a new custom block. Some of these fields will be very familiar to you - title, side, order - and so no explanation is needed here. Let's look at the new fields.

Content

The content of the block. This is where you input the content you would like displayed on the user side, in this case, your welcome message. How you format your contant depends on the next setting - type.

Type

This field sets how the content of the block will be rendered. There are four types.

HTML
HTML Mode. In this mode the field renders the content assuming it is HTML code.
PHP
PHP Mode. In this mode, the field renders the content assuming it is php code. You should be sure you are familiar with XOOPS Cube as well as php before using this mode.
Auto format with smilies
This is the handiest of the modes. It allows you to use bb code (for example [b]bold[/b]) just as in a forum. Plus your smiley shortcuts get turned into graphic smilies.
Auto format without smilies
This is the same as the previous mode except no smilies.

Go ahead then, choose "Auto format with smilies" and input a welcome message. Then, assign this block to the center block - cente, visible on the toppage only but by anyone i.e. for all groups.

Summary

Basically, site owners don't use HTML coding to create pages in XOOPS Cube Legacy. The themes offer columns as "slots" for you to assign blocks to. By assigning blocks to these columns, you can very easily and quickly create your site.

GO TO NEXT STEP