PostNuke Help

Previous
pnBlockGetInfo

Home
up

Next
pnBlockShow


pnBlockLoad

load a block

Synopsis

bool pnBlockLoad(modname, block);

Description

pnBlockLoad() loads a block into the PostNuke system.

Parameters

modname
The well-known name of a module to load the block from. This parameter can be left empty, or set to 'Core' to load core blocks.
block
The name of the block to load.

Return Values

This function returns true if the module loaded successfully, and void if an exception was raised.

Exceptions

This function raises BAD_PARAM if you pass an invalid parameter. This function raises DATABASE_ERROR if an error occurs while querying data. This function raises ID_NOT_EXIST if the block is unknown. This function raises MODULE_FILE_NOT_EXIST if the block file doesn't exist.

Notes

The PostNuke API keeps track of what blocks have been loaded, so multiple calls to pnBlockLoad() with the same parameters will return true each time.

For more information on well-known names of modules please refer to the documentation for pnModGetVar()

This function does not display the block automatically, this must be carried out by a separate call to pnBlockShow().

Examples

  // Load the past article block from the News module
  if (!pnBlockLoad('News', 'past')) {
    die('Could not load past articles block');
  }
       

See Also

pnBlockShow()


Previous
pnBlockGetInfo

Home
up

Next
pnBlockShow