Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules

Search

Donate to XOOPS!

Please select an amount to donate


Do you want your username revealed with your donation?
Yes - List me as a Generous Donor
No - List my donation as from an Anonymous Donor


Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

admin Arabic banner block Christmas comments cumulus DayDawn dhsoft e-Commerce E-Learning Git Google GUI hacks instant-zero jQuery module mygalleries news Nordic Olédrion oxygen PageRank PHP rmcommon security SEO simple-XOOPS Smarty sport tag Theme tutorial wiki WOX xoops XoopsEngine ZendFramework

New Users

Registering user

# 133946

HamptonUdolf

Welcome to XOOPS!
[Main Page]

Dev:start to make a block

From XOOPS Web Application System

Main Page | Recent changes | Edit this page | Page history | Switch to MediaWiki mode

Printable version | Disclaimers | Privacy policy
Category: Development

The Module Building document does a very good job of describing all the aspects of adding a block to your module, but there are some little details that may throw you into a tailspin.

There are 2 main files necessary for a block - the php file that gathers the data for displaying in your block, and the html (template) file that controls the layout of your block.

Here is the folder/file layout necessary for adding blocks - modulename/

   * blocks
   * templates/blocks

Following the naming conventions outlined in the wiki, the filename for the block is modulename_block_blockname.php, and it should contain 2 functions - one to query the data, and one to edit the options for the block (if any). Here is one of the important tips -> the function to display the data must return a variable named $block in order for the data to be passed to the template.

Another important thing to remember is the block may be displayed in several different modules, so any includes and links should be absolute links - relative links will vary, depending on which module is displaying.

Retrieved from "http://xoops.org/modules/mediawiki/index.php/Dev:start_to_make_a_block"

This page has been accessed 2,812 times. This page was last modified 17:27, 15 December 2007. Content is available under XOOPS Web Application System.